summary refs log tree commit diff stats
path: root/lib/packages/docutils/rstgen.nim
Commit message (Collapse)AuthorAgeFilesLines
* Rstgen/xml tree fixes (#7823)Dominik Picheta2018-05-231-29/+34
| | | | | | | | | | | | | * Don't prefix lang names with "lang" in rstgen. * Implements ability to render xmltree w/o \n. Fixes <> for `data-*` attrs. * Various rstgen fixes. * Fixes security vulnerabilities due to not escaping some code. * Adds <video> support and improve `.. image:: ` directive. * Adds comment as requested.
* RST package: don't use obsolete toLower procAndreas Rumpf2018-04-291-1/+1
|
* docutils: make ':test:' work without argumentAndreas Rumpf2018-04-151-3/+6
|
* the documentation generator now supports ':test:' for the testing of test ↵Araq2017-11-281-5/+19
| | | | snippets
* the documentation generator now supports system.runnableExamplesAraq2017-11-261-1/+1
|
* Add possibility to get language class to listings (#6705)Silvio2017-11-081-2/+2
| | | | Add the possibility to add class `lang<Name>` to code listings. Needed for restricting `run` to nim code (see https://github.com/nim-lang/nimforum/pull/111 )
* fixes #6609; 'if' expressions support multiple statements; minor breaking changeAraq2017-11-051-1/+2
|
* Remove expr/stmt (#5857)Arne Döring2017-07-251-2/+2
|
* Make countLines() the same as len(splitLines(s)) (#5470)Simon Krauter2017-03-031-1/+1
| | | | | The result of countLines() is now increased by 1 compared to the old version. Fixes #5460.
* docgen: working search featureAraq2016-09-091-3/+3
|
* generated theindex.html is valid htmlAraq2016-09-091-10/+21
|
* Merge pull request #3831 from ephja/nimrod-to-nimAndreas Rumpf2016-02-061-2/+2
|\ | | | | nimrod -> nim
| * nimrod -> nimErik Johansson Andersson2016-02-051-2/+2
| |
* | RST: Output <object> for SVG images in HTMLFelix Krause2016-02-021-7/+17
|/
* Made docgen emit valid XML by defaultFelix Krause2016-01-111-2/+2
|
* udpated the compiler and tester to use getOrDefaultAraq2015-10-131-10/+13
|
* Fix for image directive with periodssingularperturbation2015-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saw in https://github.com/nim-lang/nimforum/issues/41 that there was an issue in rendering inline images. Traced back through rstgen and found that it was not counting something like: `.. image:: http://i.imgur.com/oCem13Y.png` as valid since it contained a period, and this wasn't in the set of valid characters, so the empty string is returned by default. Added a period to the allowable characters, and now renders correctly. Test case: ``` import rst, rstgen, strtabs var docConfig: StringTableRef docConfig = rstgen.defaultConfig() docConfig["doc.smiley_format"] = "/images/smilieys/$1.png" proc rstToHtml(content: string): string = result = rstgen.rstToHtml(content, {roSupportSmilies,roSupportMarkdown}, docConfig) var a: string = rstToHtml(".. image:: http://i.imgur.com/oCem13Y.png") echo a ```
* documentation generator emits configurable html for code listingsAraq2015-07-141-6/+14
|
* lib/packages/docutils - Dropped 'T' from typespdw2015-06-041-60/+61
|
* Turn some test outputs into actual testsOleh Prypin2015-04-211-3/+4
|
* Don't run non-test code when defined(testing)Oleh Prypin2015-04-211-1/+1
|
* fixes #2476Araq2015-04-191-132/+132
|
* rstgen: Unique reference names in TOCdef2015-03-131-1/+8
| | | | | - Fixes #2269 - Keeps track of higher level section to create unique reference names
* Replaced deprecated repeatStr() with repeat().Hans Raaf2015-03-041-2/+2
|
* Replaced deprecated repeatChar() with repeat() or spaces().Hans Raaf2015-03-041-1/+1
|
* Fix typosFederico Ceratto2015-02-151-1/+1
|
* Replace other common expressions with defined variableDustin Lacewell2015-01-121-2/+2
|
* Add named anchor links to procs in the documentation indexDustin Lacewell2015-01-121-2/+4
|
* Improved nimdoc styling.Nick Greenfield2014-12-191-2/+2
| | | | | | | This updates the inlined CSS in nimdoc.cfg, adds several helper classes (and a few divs) to the generated HTML (some in nimdoc.cfg, one in rstgen.nim), and tweaks the anchor linking scheme for headers in rstgen.nim.
* Moved smiliey format to config hash table.Dominik Picheta2014-12-041-5/+3
|
* smileys configurable; safer image attribute handlingAraq2014-11-291-18/+24
|
* fixes #1055Araq2014-11-161-4/+4
|
* Merge branch 'pr_adds_code_directive_to_rst' into ↵Grzegorz Adam Hankiewicz2014-11-031-14/+103
|\ | | | | | | | | | | | | | | | | pr_bigbreak_adds_code_directive_to_rst Conflicts: doc/tut2.txt lib/packages/docutils/rstgen.nim lib/system.nim
| * Fixes line numbering.Grzegorz Adam Hankiewicz2014-10-021-1/+1
| |
| * Handles :file: option for code blocks to avoid warnings.Grzegorz Adam Hankiewicz2014-07-261-0/+7
| |
| * Adds support for the ``.. code::`` rst directive.Grzegorz Adam Hankiewicz2014-07-191-14/+96
| | | | | | | | | | | | This modifies the existing ``.. code-block::`` to be treated as spec extension with a specific default language syntax. Also implements line numbering.
* | updated the compiler to use the new symbol namesAraq2014-08-281-10/+10
| |
* | renamefestAraq2014-08-231-6/+6
| |
* | the big renamefest: first stepsAraq2014-08-221-6/+6
| |
* | Escapes properly code blocks without highlite support.Grzegorz Adam Hankiewicz2014-07-281-1/+1
|/
* Computes TIndexEntry hash without temporary strings.Grzegorz Adam Hankiewicz2014-05-241-5/+6
|
* Adds colon to symbols in the index.Grzegorz Adam Hankiewicz2014-04-211-1/+1
| | | | | The colon makes it easier to get a unique match searching for symbols using words which may also appear as substrings or elsewhere.
* Inserts the title index term at the beginning of the buffer.Grzegorz Adam Hankiewicz2014-04-211-21/+34
|
* Removes text TOCs from the symbol index.Grzegorz Adam Hankiewicz2014-04-211-1/+6
|
* Assigns default title to module documentation.Grzegorz Adam Hankiewicz2014-04-211-4/+12
|
* Reduces length of lines to remove compilation warnings.Grzegorz Adam Hankiewicz2014-04-211-14/+16
|
* Fixes title and subtitle not setting the current section.Grzegorz Adam Hankiewicz2014-04-211-2/+2
|
* Fixes repeated index terms leading to same HTML anchor.Grzegorz Adam Hankiewicz2014-04-211-2/+18
| | | | | Instead of a hash for the rst node tree (which will always be the same) a simple counter table is used.
* Indexes tocs of documents even if they don't show any.Grzegorz Adam Hankiewicz2014-04-211-6/+6
|
* Generates quick jump list to modules.Grzegorz Adam Hankiewicz2014-04-211-4/+24
|
class="w"> .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. .0 x. .stash [abc] . .add 2, 2 . .4 . .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. . . ] # click on the code in the sandbox assume-console [ left-click 4, 21 ] run [ event-loop screen:address:shared:screen, console:address:shared:console, 2:address:shared:programming-environment-data ] # trace now printed above result screen-should-contain [ . run (F4) . . . .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. .0 x. .stash [abc] . .add 2, 2 . .abc . .4 . .━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━. . . ] ] container sandbox-data [ trace:address:shared:array:character display-trace?:boolean ] # replaced in a later layer def! update-sandbox sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data, idx:number -> sandbox:address:shared:sandbox-data, env:address:shared:programming-environment-data [ local-scope load-ingredients data:address:shared:array:character <- get *sandbox, data:offset response:address:address:shared:array:character <- get-address *sandbox, response:offset trace:address:address:shared:array:character <- get-address *sandbox, trace:offset fake-screen:address:address:shared:screen <- get-address *sandbox, screen:offset *response, _, *fake-screen, *trace <- run-interactive data ] # clicks on sandbox code toggle its display-trace? flag after <global-touch> [ # check if it's inside the code of any sandbox { sandbox-left-margin:number <- get *current-sandbox, left:offset click-column:number <- get *t, column:offset on-sandbox-side?:boolean <- greater-or-equal click-column, sandbox-left-margin break-unless on-sandbox-side? first-sandbox:address:shared:sandbox-data <- get *env, sandbox:offset break-unless first-sandbox first-sandbox-begins:number <- get *first-sandbox, starting-row-on-screen:offset click-row:number <- get *t, row:offset below-sandbox-editor?:boolean <- greater-or-equal click-row, first-sandbox-begins break-unless below-sandbox-editor? # identify the sandbox whose code is being clicked on sandbox:address:shared:sandbox-data <- find-click-in-sandbox-code env, click-row break-unless sandbox # toggle its display-trace? property x:address:boolean <- get-address *sandbox, display-trace?:offset *x <- not *x hide-screen screen screen <- render-sandbox-side screen, env, 1/clear screen <- update-cursor screen, current-sandbox, env # no change in cursor show-screen screen loop +next-event:label } ] def find-click-in-sandbox-code env:address:shared:programming-environment-data, click-row:number -> sandbox:address:shared:sandbox-data [ local-scope load-ingredients # assert click-row >= sandbox.starting-row-on-screen sandbox <- get *env, sandbox:offset start:number <- get *sandbox, starting-row-on-screen:offset clicked-on-sandboxes?:boolean <- greater-or-equal click-row, start assert clicked-on-sandboxes?, [extract-sandbox called on click to sandbox editor] # while click-row < sandbox.next-sandbox.starting-row-on-screen { next-sandbox:address:shared:sandbox-data <- get *sandbox, next-sandbox:offset break-unless next-sandbox next-start:number <- get *next-sandbox, starting-row-on-screen:offset found?:boolean <- lesser-than click-row, next-start break-if found? sandbox <- copy next-sandbox loop } # return sandbox if click is in its code region code-ending-row:number <- get *sandbox, code-ending-row-on-screen:offset click-above-response?:boolean <- lesser-than click-row, code-ending-row start:number <- get *sandbox, starting-row-on-screen:offset click-below-menu?:boolean <- greater-than click-row, start click-on-sandbox-code?:boolean <- and click-above-response?, click-below-menu? { break-if click-on-sandbox-code? return 0/no-click-in-sandbox-output } return sandbox ] # when rendering a sandbox, dump its trace before response/warning if display-trace? property is set after <render-sandbox-results> [ { display-trace?:boolean <- get *sandbox, display-trace?:offset break-unless display-trace? sandbox-trace:address:shared:array:character <- get *sandbox, trace:offset break-unless sandbox-trace # nothing to print; move on row, screen <- render screen, sandbox-trace, left, right, 245/grey, row } <render-sandbox-trace-done> ]