Commit graph

70 commits

Author SHA1 Message Date
Andreas Rumpf
73799903ee removed global variable from rstgen.nim 2018-05-27 23:38:49 +02:00
Dominik Picheta
85b7d8fcc4 Rstgen/xml tree fixes (#7823)
* 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.
2018-05-23 16:28:53 +02:00
Andreas Rumpf
68a63b3407 RST package: don't use obsolete toLower proc 2018-04-29 01:08:37 +02:00
Andreas Rumpf
ed9c28484a docutils: make ':test:' work without argument 2018-04-15 22:16:07 +02:00
Araq
5d2e86ea1a the documentation generator now supports ':test:' for the testing of test snippets 2017-11-28 01:15:33 +01:00
Araq
8d1a5dc8e7 the documentation generator now supports system.runnableExamples 2017-11-26 02:51:11 +01:00
Silvio
d837ef177c Add possibility to get language class to listings (#6705)
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 )
2017-11-08 11:12:05 +01:00
Araq
742f43e572 fixes #6609; 'if' expressions support multiple statements; minor breaking change 2017-11-05 01:26:04 +01:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Simon Krauter
a42801d100 Make countLines() the same as len(splitLines(s)) (#5470)
The result of countLines() is now increased by 1 compared to the old
version.
Fixes #5460.
2017-03-03 01:31:17 +01:00
Araq
3dfc866710 docgen: working search feature 2016-09-09 20:42:02 +02:00
Araq
37c3c0033d generated theindex.html is valid html 2016-09-09 16:16:58 +02:00
Andreas Rumpf
981974ab11 Merge pull request #3831 from ephja/nimrod-to-nim
nimrod -> nim
2016-02-06 15:24:09 +01:00
Erik Johansson Andersson
f8d98700ac nimrod -> nim 2016-02-05 19:11:43 +01:00
Felix Krause
facd4c6f19 RST: Output <object> for SVG images in HTML 2016-02-02 20:20:59 +01:00
Felix Krause
708b9f90b7 Made docgen emit valid XML by default 2016-01-11 22:52:59 +01:00
Araq
8be9e46403 udpated the compiler and tester to use getOrDefault 2015-10-13 14:10:33 +02:00
singularperturbation
4c1611fc13 Fix for image directive with periods
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
```
2015-08-02 14:16:53 -05:00
Araq
f7bdc205c7 documentation generator emits configurable html for code listings 2015-07-14 01:37:09 +02:00
pdw
7616790515 lib/packages/docutils - Dropped 'T' from types 2015-06-04 13:17:10 +02:00
Oleh Prypin
22db40e5e4 Turn some test outputs into actual tests 2015-04-21 15:59:32 +03:00
Oleh Prypin
32109a7867 Don't run non-test code when defined(testing) 2015-04-21 14:37:29 +03:00
Araq
5cea6807e1 fixes #2476 2015-04-19 02:43:19 +02:00
def
0255876055 rstgen: Unique reference names in TOC
- Fixes #2269
- Keeps track of higher level section to create unique reference names
2015-03-13 01:32:23 +01:00
Hans Raaf
b902ea887b Replaced deprecated repeatStr() with repeat(). 2015-03-04 03:44:09 +01:00
Hans Raaf
58186f6c1d Replaced deprecated repeatChar() with repeat() or spaces(). 2015-03-04 03:30:43 +01:00
Federico Ceratto
657dca5c3b Fix typos 2015-02-15 16:20:32 +00:00
Dustin Lacewell
9e4ee03c2c Replace other common expressions with defined variable 2015-01-12 11:20:26 -08:00
Dustin Lacewell
ff941fd489 Add named anchor links to procs in the documentation index 2015-01-12 10:53:02 -08:00
Nick Greenfield
fb93cee95d Improved nimdoc styling.
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.
2014-12-19 21:08:11 -05:00
Dominik Picheta
898501d9d1 Moved smiliey format to config hash table. 2014-12-04 18:47:01 +00:00
Araq
80b8361187 smileys configurable; safer image attribute handling 2014-11-29 13:55:30 +01:00
Araq
8349cee613 fixes #1055 2014-11-16 20:32:05 +01:00
Grzegorz Adam Hankiewicz
a7aa2de166 Merge branch 'pr_adds_code_directive_to_rst' into pr_bigbreak_adds_code_directive_to_rst
Conflicts:
	doc/tut2.txt
	lib/packages/docutils/rstgen.nim
	lib/system.nim
2014-11-03 15:50:05 +01:00
Grzegorz Adam Hankiewicz
2df195c8e2 Fixes line numbering. 2014-10-02 00:59:07 +02:00
Araq
5946747970 updated the compiler to use the new symbol names 2014-08-28 23:48:42 +02:00
Araq
2f43fdb837 renamefest 2014-08-23 01:43:49 +02:00
Araq
dbf9117c56 the big renamefest: first steps 2014-08-22 23:54:26 +02:00
Grzegorz Adam Hankiewicz
69949c07b7 Escapes properly code blocks without highlite support. 2014-07-28 23:22:39 +02:00
Grzegorz Adam Hankiewicz
b287f13d4a Handles :file: option for code blocks to avoid warnings. 2014-07-26 14:39:01 +02:00
Grzegorz Adam Hankiewicz
0dbec5a278 Adds support for the `.. code::` rst directive.
This modifies the existing ``.. code-block::`` to be treated as spec
extension with a specific default language syntax. Also implements line
numbering.
2014-07-19 13:56:42 +02:00
Grzegorz Adam Hankiewicz
489d7e526d Computes TIndexEntry hash without temporary strings. 2014-05-24 11:52:56 +02:00
Grzegorz Adam Hankiewicz
7f090983e9 Adds colon to symbols in the index.
The colon makes it easier to get a unique match searching for symbols
using words which may also appear as substrings or elsewhere.
2014-04-21 23:37:12 +02:00
Grzegorz Adam Hankiewicz
51949fd373 Inserts the title index term at the beginning of the buffer. 2014-04-21 23:27:26 +02:00
Grzegorz Adam Hankiewicz
bd29e007be Removes text TOCs from the symbol index. 2014-04-21 21:07:26 +02:00
Grzegorz Adam Hankiewicz
8b1430811a Assigns default title to module documentation. 2014-04-21 21:07:26 +02:00
Grzegorz Adam Hankiewicz
d31638a103 Reduces length of lines to remove compilation warnings. 2014-04-21 21:07:26 +02:00
Grzegorz Adam Hankiewicz
ed713a8f5e Fixes title and subtitle not setting the current section. 2014-04-21 21:07:25 +02:00
Grzegorz Adam Hankiewicz
831e12d8f8 Fixes repeated index terms leading to same HTML anchor.
Instead of a hash for the rst node tree (which will always be the same)
a simple counter table is used.
2014-04-21 21:07:25 +02:00
Grzegorz Adam Hankiewicz
7808ad97a5 Indexes tocs of documents even if they don't show any. 2014-04-21 21:05:39 +02:00