Giter Site home page Giter Site logo

docs's Introduction

docs's People

Contributors

225559 avatar 9214 avatar asampal avatar bgrossot avatar dander avatar dockimbel avatar endo64 avatar eranws avatar geekyi avatar gitter-badger avatar gltewalt avatar greggirwin avatar gunnarahlberg avatar hiiamboris avatar loziniak avatar mark-summerfield avatar nedzadarek avatar palaing avatar pekr avatar peterwawood avatar qtxie avatar toomasv avatar tovim avatar wallysilva avatar x8x avatar xdminsy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Unnecessary example in error! doc

It is not necessary to put below example in the end of section 3 (Creation) in error! datatype doc: page: https://doc.red-lang.org/en/datatypes/error.html#_creation

Arg values in the block are reduced.

>> cause-error 'syntax 'missing [foo bar]
*** Script Error: foo has no value
*** Where: reduce
*** Stack: cause-error

It is obvious that foo has no value and the error is not related to usage of cause-error function.

It can be removed or changed to

Arg values in the block are reduced.

>> foo: "foo" bar: "bar"
>> cause-error 'syntax 'missing [foo bar]
*** Syntax Error: missing "foo" at "bar"
*** Where: reduce
*** Stack: cause-error

float `to` binary conversion needs improvement

See: https://gitter.im/red/docs?at=5cfe6e31e41fe15e7544d0ae

My suggestions:

The any-list part could remove some prose.

An any-list! value must contain two numbers. The result will be the first number multiplied with the value of 10 to the power of the truncated second number. first-number * (power 10 second-number)

Could be

An any-list! value must contain two numbers. The result will be first-number * (10 ** second-number)

The binary example is backwards from the text. It described to float!. And your new text seems better. Beyond that, an example of what happens with truncated data (less than 8 bytes) should either be included, or we should say that's not supported.

VID documentation formatting issues

Section 6.1 Keywords breaks off on draw keyword description, and after that wrap becomes a top level header, wrapping all subsequent keyword definitions.

On closer examination, this happens because draw section contains ragged code fences caused by this.

Shape dialect's `arc` <angle> explanation is wrong

Documentation (https://doc.red-lang.org/en/draw.html#_arc_2) says:

<angle> : angle between the starting and ending points of the arc in degrees (integer! float!).

Should be: <angle> : rotation angle of the underlying ellipse in degrees (integer! float!).

Explanation: In following code angle between start and end points is 0 but rotation angle of ellipse is 45:

view [box 100x100 draw [shape [move 30x50 arc 70x50 30 20 45 large]]]

CALL /show refinement description is inaccurate

>> ? call
....
     /show        => Force the display of system's shell window (Windows only).
....

Two problems:

  1. "of shell window" wording is misleading
  2. it is reflected nowhere that without this flag the window will be forcefully hidden

Because, as seen from https://github.com/red/red/blob/8d712e4ba1b16e1b7a339006d1154aebc9cb7ce4/runtime/call.reds#L324
in the absence of /show it uses the wShowWindow field of STARTUPINFO structure, which is never initialized explicitly and thus defaults to 0 = SW_HIDE. As a consequence, any GUI program called without /show cannot be interacted with (try call {notepad.exe}). (Although due to a bug some Red GUI programs are still visible partly on W7 - only those parts that are emulated using layered windows mechanics, but it's another topic)

some faces miss listings of supported event types

In View reference docs, some of the face types have tables with descriptions of supported event types and their respective handlers, but some do not:

  • base
  • text
  • progress
  • slider
  • camera
  • window
  • screen
  • group-box

Undocumented set-focus for positioning cursor in a text box so the user doesn't need mouse click

amreus @amreus 08:57 found this for me on 12/29/2018

I found myself having to click on a text box each time I entered text because the control lost focus.

The set-focus worked beautifully but neither amreus or myself found it in the documentation.

amreus provided the following example and it worked like a charm!

Red [
needs: 'view
]

view [
f1: field focus
f2: field
f3: field
b: button "Set Focus" [set-focus f3]
]

DOC: various peculiarities of make bitset!

@meijeru commented on Tue Apr 18 2017

  1. charset is shorthand for make bitset! except it does not cover make bitset! <binary>. This does make sense since charset suggests we deal with code point numbers, but it is useful to point out.
  2. charset 5 makes a single-byte empty bitset, charset #"^E" makes #{04}, BUT both charset [5] and charset [#"^E"] make #{04}. In other words, make bitset! <integer> is treated as storage reservation, as with all series! values, although bitset! does not belong to series!. It is questionable which kind of (in)consistency is less confusing for the user. In any case, the chosen solution has to be documented...
  3. charset [32 - #"Z"] is allowed, in other words, integers and code points may be freely mixed in the spec block.

@meijeru commented on Wed Apr 19 2017

Point 3 is solved by the fixes to #2587

bug at compile tine

in this code https://gist.github.com/tinulac-leinad/00a0e9a85e13782858eab2a71bc2ac59
there is a problem with I: here :

tune: object [
  tA: tB: tC: tD: tE: tF: tG: tH: I: tK: tL: tM: tN: tO: tP: tQ: tR: tS: tT: tX: tZ: ""
                                             

in the REPL the code work fine....
when I compile with -c it's ok
when I compile with -r -> error


Compiling /home/daniel/Apps/red/red_projets/dn-abc-tools/test.red ...
...compilation time : 1875 ms

Target: Linux 

Compiling to native code...
*** Compilation Error: argument type mismatch on calling: red/natives/repeat-init* 
*** expected: [struct! [
        header [integer!] 
        data1 [integer!] 
        data2 [integer!] 
        data3 [integer!]
    ]], found: [struct! [
        header [integer!] 
        ctx [pointer! [integer!]] 
        symbol [integer!] 
        index [integer!]
    ]] 
*** in file: %/home/daniel/Apps/red/red_projets/dn-abc-tools/test.red 
*** in function: exec/f_ctx||394~value-path?
*** at line: 1 
*** near: [
    r3: 0 
    stack/reset integer/push 0 
    stack/mark-loop ~repeat 
    while
]

and just this simple code cause the same error :

Red[]
I: none

[VIEW] In 'Draw block in a Face, "Set-word" used as a position mark is updated. It's not like what the document said.

@JenniferLee520 commented on Sat Jun 10 2017

According to the "Draw" documentation

  1. Source position

Set-words can be used in the Draw code in-between commands to record the current position in Draw block and be able to easily access it later.
Note:
If the Draw block length preceding a set-word is changed, the recorded position will not be updated.

But somehow, the position can be updated.

view [ 
    origin 0x0
    base 800x400 draw [
        fill-pen green
        pos: box 400x0 450x100
    ] on-down [
        probe pos
        insert face/draw [pen red]
    ]
]

Run the code. "pen red" will be inserted into the draw block every time you click on the face. But as you will see: it's updated. In the following result, I clicked 4 times.

>> do %pos-test.red
[box 400x0 450x100]
[box 400x0 450x100]
[box 400x0 450x100]
[box 400x0 450x100]

@dockimbel commented on Sat Jul 29 2017

It's a wording issue in the note, the "recorded position" refers to the initial position.

I'm changing it to:

NOTE: If the Draw block length preceeding a set-word is changed, the original position will be changed accordingly, so the set-word will not point to the same reference anymore.

Bugs in `declare!` docs

1


s/c: declare struct! [d [integer!] e [float!]] it should be

2

And just below:

12 + 4 (integer) + 8 (float) = 24 in my book, not 20 bytes

3

The returned value of DECLARE STRUCT! is the memory address of the newly created struct! value.

It is never stated that structure is static (only allocated once), so is dangerous to use inside functions (see red/red@069f335 commit)

DOC: various peculiarities of make bitset!

@meijeru commented on Tue Apr 18 2017

  1. charset is shorthand for make bitset! except it does not cover make bitset! <binary>. This does make sense since charset suggests we deal with code point numbers, but it is useful to point out.
  2. charset 5 makes a single-byte empty bitset, charset #"^E" makes #{04}, BUT both charset [5] and charset [#"^E"] make #{04}. In other words, make bitset! <integer> is treated as storage reservation, as with all series! values, although bitset! does not belong to series!. It is questionable which kind of (in)consistency is less confusing for the user. In any case, the chosen solution has to be documented...
  3. charset [32 - #"Z"] is allowed, in other words, integers and code points may be freely mixed in the spec block.

@meijeru commented on Wed Apr 19 2017

Point 3 is solved by the fixes to #2587

Some suggestions about documentation formatting

Here are some suggestions about the formatting of documentation which came up while I was working on the translation. The goal is to make the documentation look less confusing and more compatible with different translations in terms of formatting.

Document Header

Suggestion: Add an attribute :toc-title: Table of Contents.

Reason: This attribute represents the TOC label. The translator only need to change "Table of Contents" to the translated language without adding a new attribute manually.

Bold and Italic

Suggestion: Always using __text__ and **text** instead of _text_ and *text*.

Reason: Like in Chinese and Japanese, there is no spacing between words, so single _ or * will be treated as normal texts instead of formatting instructions. It is better to avoid translators changing the formatting manually.

Link and Anchor

Suggestion: Always use link:url[text] syntax. Note the link: prefix must be added.

Reason: This can work without spacing around the link. Maybe just I can't figure out how to make << xxx >> work.

Suggestion: Always using link:#a-anchor[text] for links within the document and add an explicit anchor ID [#a-anchor] right above the section title to link.

Reason: The anchor for a section is dependent on the text of that section, which can be messed up after translation. This works across different translations.

Suggestion: Use link:another-document.adoc[text] for links between documents. Note the extension of the link is adoc.

Reason: This makes the link works both on github and gitbook. Gitbook will automatically change .adoc to .html.

Admonition

Suggestion: Always using the syntax described below (NOTE can be other type):

[NOTE, caption=Note]
====
Something to note.
====

Reason: That "Note" of the caption attribute is the label displayed in the left of the admonition block. The translator only need to change into translated language without changing the formatting. The label of inline admonitions (NOTE: ) can't be changed (or maybe I couldn't figure it out).

Word Name

Suggestion: Always surround the word which means Red word with ` (also in section titles, without uppercase).

Reason: Red word (keyword in DSL, or function name) is not that distinguishable from normal English words (in my opinion). If it is used in section titles without surrounded in a code span, it can be hard for translators to decide whether to translate it or not, and also may be confusing for normal readers. I have tried to make it a code span in the section title and it renders good.

Suggestion: Maybe avoid using red-words like normal English words in sentences.

Reason: Like the example below from the description of check in view.adoc, It sounds stupid if I keep left and right as is after translating. Or wrap left and right into a parenthesis and annotate after translating left and right, which also doesn't looks so good.

para: The align field controls if the text is displayed on the left or on the right side.

para: align 字段控制该文本是靠 left 边显示还是靠 right 边显示。

para: align 字段控制该文本是靠左边(left)显示还是靠右边(right)显示。

Type Annotation

Suggestion: Unify the type annotation over all documentation.

Reason: It is good to do so. Currently it can appear in two different kind of contents (see below), function syntax code blocks and some tables. It is not always at the end of a paragraph.

From macro of preprocessor:

#macro <name> func <spec> <body>
#macro <pattern> func <spec> <body>

<name>    : name of the macro function (set-word!).
<pattern> : matching rule for triggering the macro (block!, word!, lit-word!).
<spec>    : specification block for the macro function.
<body>    : body block of the macro function.

From Event! datatype of view:

|`offset`| Offset of mouse cursor relative to the face object when the event occurred (`pair!`). For gestures events, returns the center point coordinates.

Suggestion: Don't use "," to separate multiple types, nor "or" needed.

Reason: Removing these won't cause confusion. The datatype won't lose coloring as the example of #macro above.

Spacing

Suggestion: Always add a separate line between the actual content.

Reason: This can avoid content format corruption in some languages.

Version selector is confusing

Version 0.6.0 does not have a version selector, but 0.6.1 does, and it allows selection of 0.6.0, 0.6.1 and 0.6.2. However, 0.6.2 is not (yet) available. Moreover, the default value shown in the version selector is 0.6.2, so the impression is created that this version is selectable. I propose that in each version, the version selector shows THAT version as default. This is a better way of finding out which version one is in, than to look at the URL in the address box.

Japanese document fix list

I would fix/improve problems below,

view.html

  • "オプションファセット" should be "Options ファセット".
    gitter talk about it: 2018年2月2日 15:28
  • "追加の関数" is too literally translated. "その他の関数" might be better.
  • The sentence below should be deleted(original English sentence left).

A vertical scroll-bar can appear if all lines of text cannot be visible in the area (might be controlled by a flags option in the future).

Add docs for Red #system directive

Right now there's no documentation present for the #system directive introduced with this commit: red/red@c9cfa3f

It's only mentioned in an example for the #call directive in the red/system spec: https://static.red-lang.org/red-system-specs.html#section-16.8

Having it added to the directives of the red docs would help in making people aware that it's possible to call red/system code from red using this directive. Otherwise it's kind of hidden and might only be found by accident or a long search.

Also not sure if i'm the right person to make a pull request for that as, I'm still learning and getting familiar with red and its environment. But I guess the commit message provides enough information (at least for me) about what it is and how to use it. So maybe only one or two examples are missing for a proper doc entry.

Thank you very much!

Add note to binary! about how chars append with `/part`.

From Gitter chat: https://gitter.im/red/bugs?at=5ec5643626d26710bba95dbf

If we think of it as "The value is first coerced to a type compatible with the series, then the part is taken." we get what we have now. Easy to understand. This is similar:

>> append/part {} 'a/b/c 2
== "a/"

Where the path is first formed, then part of that taken. Knowing this behavior, we can add a doc note that shows how to work around it if you want to append full chars to binaries. e.g.

>> append #{} copy/part "^(2190)XYZ" 1
== #{E28690}

`qcurv` documentation

Part 1 of red/red#3789 was never solved

  1. Contrary to the docs, qcurv accepts 1 or more points.
  2. The docs don't say that it continues what qcurve or other qcurvs might have started (using the latest pair of points from these directives)

WISH: Make the asciidoc content format compatible with possible coming document translations

I am working on Chinese translation of the documents. I find if only changing the text(no line added), the contents in github will be corrupted(like that original Japanese translation). After I add lines seperating elements(eg, header, code blocks), it will renders correctly. It seems seperated lines are need for some languages.

I can add lines needed while translating the documents. If permitted(needed), I will be happy to help.

In description of check face, there is a typo

In view.adoc:

|`type`| `'check`
|`text`| Label text.
|`para`|	The `align` field controls if the text is displayed on the `left` or on the `right` side.
`data`, `true`: checked; `false`: unchecked (default).

I assume that the last line needs a | in front of it , and another | in place of the ,

area scroll bars go to top when appending to area text with no word to scroll it to bottom

Every time I append to the area that it scrolls the who way back up to the top even if I had i scrolled all the way down to the bottom. For things like logging and chat session and chat bots like I'm doing the information being added to the bottom is usually what the user is most interested in.

When I append text to an area, at some point the text is hidden from the user because it is scrolled off the screen. Is there a Red word I can use to tell the scroll bar on the area to scroll down so the user knows the new text has been appended. Otherwise I would have to inform the user to manually scroll to the bottom if he does not see a response in the area.

Rename pixel format to RGBT

Temporarily rename rgba to rgbt until Red Team makes a final decision.

Per discussion in red/redfrom @dockimbel :

"In Redbol, we rely on the notion of transparency (you ask: "how transparent it is?", not "how opaque it is?"), which is more human-friendly than opacity (which is an alpha channel mask), so we should maybe rather call our pixel format RGBT, rather than RGBA."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.