Commit Graph

55 Commits

Author SHA1 Message Date
Erich Reitz
5dfa1345fa related #22534; fixes documentation rendering of custom number literal routine declaration (#23015)
I'm not sure if this is a complete fix, as it does not match the
expected output given in the issue. The expected output given in the
issue highlights the identifier after the `'` the same color as numeric
literals (blue), and this change does not address that. I think that
would involve simplifying `nimNumberPostfix`.

However, this fixes the issue where the routine declaration was rendered
as a string.
New rendering: 
![Screenshot from 2023-11-30
22-17-17](https://github.com/nim-lang/Nim/assets/80008541/b604ce27-a4ad-496b-82c3-0b568d99a8bf)
2023-12-01 07:21:42 +01:00
ringabout
4d11d0619d complete std prefixes for stdlib (#22887)
follow up https://github.com/nim-lang/Nim/pull/22851
follow up https://github.com/nim-lang/Nim/pull/22873
2023-10-30 17:03:04 +01:00
ringabout
a55604a3d8 fixes #21232; highlite.getNextToken() returns gtOperator for '/' in C (#21234) 2023-01-08 15:40:27 +01:00
ringabout
75ece74bdd fixes #20526; use nimPreviewSlimSystem for documentation build (#20714)
* fixes #20526; use `nimPreviewSlimSystem` for `koch docs`

* fixes documentation errors

* fixes remaning issues
2022-11-01 12:53:14 +01:00
Andrey Makarov
19ff746916 Markdown code blocks migration part 7 (#20547) 2022-10-12 16:13:43 +02:00
ringabout
e8ae2dc90b bootstrap the compiler with nimPreviewSlimSystem (#20176)
* bootstrap the compiler with nimPreviewSlimSystem

* threads
2022-08-09 16:32:29 +08:00
Andrey Makarov
417b90a7e5 Improve Markdown code blocks & start moving docs to Markdown style (#19954)
- add additional parameters parsing (other implementations will just
  ignore them). E.g. if in RST we have:

  .. code:: nim
     :test: "nim c $1"

     ...

  then in Markdown that will be:

  ```nim test="nim c $1"
  ...
  ```

- implement Markdown interpretation of additional indentation which is
  less than 4 spaces (>=4 spaces is a code block but it's not
implemented yet). RST interpretes it as quoted block, for Markdown it's
just normal paragraphs.
- add separate `md2html` and `md2tex` commands. This is to separate
  Markdown behavior in cases when it diverges w.r.t. RST significantly —
most conspicously like in the case of additional indentation above, and
also currently the contradicting inline rule of Markdown is also turned
on only in `md2html` and `md2tex`. **Rationale:** mixing Markdown and
RST arbitrarily is a way to nowhere, we need to provide a way to fix the
particular behavior. Note that still all commands have **both** Markdown
and RST features **enabled**. In this PR `*.nim` files can be processed
only in Markdown mode, while `md2html` is for `*.md` files and
`rst2html` for `*.rst` files.
- rename `*.rst` files to `.*md` as our current default behavior is
  already Markdown-ish
- convert code blocks in `docgen.rst` to Markdown style as an example.
  Other code blocks will be converted in the follow-up PRs
- fix indentation inside Markdown code blocks — additional indentation
  is preserved there
- allow more than 3 backticks open/close blocks (tildas \~ are still not
  allowed to avoid conflict with RST adornment headings) see also
https://github.com/nim-lang/RFCs/issues/355
- better error messages
- (other) fix a bug that admonitions cannot be used in sandbox mode; fix
  annoying warning on line 2711
2022-07-15 19:27:54 +02:00
Bung
16f0b55664 remove isKeywordIgnoreCase from highlite, not used , can't even compile with -d:useNimRtl (#18399) 2021-06-30 07:28:41 +02:00
Andrey Makarov
436af88d8c follow-up #17837: add Console for interactive sessions (#17930)
* follow-up #17837: add `Console` for interactive sessions

* fix Latex
2021-05-06 10:58:01 +02:00
Andrey Makarov
287f1170ba highlite: fix #17890 - tokenize Nim escape seq-s (#17919)
* highlite: fix #17890 - tokenize Nim escape seq-s

* Update tests/stdlib/thighlite.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-05-03 10:21:36 +02:00
Andrey Makarov
8f79bc5f3d add RST highlighting for command line / shells (also fixes #16858) (#17789) 2021-04-21 16:57:54 +02:00
Andrey Makarov
42687457b0 further progress on rst roles & directives (fix #17646) (#17659)
* further progress on rst roles & dir-s (fix #17646)

* fix documents according to the messages

* fix bug 17 from #17340
2021-04-08 19:00:14 +02:00
Timothee Cour
8b26b3ad0d remove docutils.nimble (not a real nimble package, and affected canonical imports) (#17544)
* remove docutils.nimble (not a real nimble package, and affected canonical imports)

* cleanup redundant references
2021-03-29 12:46:53 +02:00
Clyybber
507873be25 Use readable escape sequences (#17241) 2021-03-03 07:15:07 +01:00
Danil Yarantsev
285539c87a Replace double backticks with single backticks - Part 4 out of ~7 (#17216) 2021-03-01 18:00:58 -08:00
flywind
f140c92409 fix some warnings (#16952) 2021-02-08 13:50:15 +01:00
Xabier Bello
4c533b2d92 Added Python to highlite module. (#16286)
* Added Python to highlite module.
* Added the keywords for Python

* Refactored the 'pythonLikeNextToken' into 'nimNextToken':

- `lang` property added to GeneralTokenizer object, is set in `getNextToken`.
- `nimNextToken` accepts `keywords` parameter, used for languages different
  from Nim.
- Multiline comment available only for `langNim`.
2020-12-08 10:44:07 +01:00
Juan Carlos
d85015e922 Remove unroll pragma from stdlib (#14706) 2020-08-26 16:51:41 +02:00
Araq
6f962a4b36 fixes #14830 2020-07-06 13:41:56 +02:00
Araq
c94647aeca styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error 2019-07-10 12:42:41 +02:00
Juan Carlos
206f2478b8 Documentation highlite (#11596)
* Add Documentation with examples for highlite

* Add Documentation with examples for highlite
2019-06-26 10:28:11 +02:00
Miran
8cf97908cc document proper imports, fixes #8164 (#10698) 2019-02-19 12:49:09 +01:00
Araq
cb9e9297fb make highlite.nim compile again 2018-08-23 10:46:24 +02:00
Oscar Nihlgård
fd28236368 Multi byte characters should not be treated as part of an operator 2018-06-03 09:05:50 +02:00
Dmitry Atamanov
e206a8d952 Use new binarySearch everywhere (#7876) 2018-05-25 00:04:30 +03:00
Araq
5d2e86ea1a the documentation generator now supports ':test:' for the testing of test snippets 2017-11-28 01:15:33 +01:00
Andreas Rumpf
cae5e33a4a language change: 'generic' and 'atomic' are not keywords anymore 2017-11-21 11:27:35 +01:00
Araq
3ccc9c467d 'with' and 'without' are not keywords anymore 2017-09-30 18:32:44 +02:00
Andreas Rumpf
20ee65af6d fixes #3078 2016-10-20 21:40:04 +02:00
Felix Krause
6fe916fc77 Fixes to YAML highlighting support, added tests 2016-04-01 21:35:46 +02:00
Felix Krause
f1f1202ea0 Added YAML support to doctools/highlite 2016-03-29 22:49:34 +02:00
Andreas Rumpf
c9966a3e17 use 'using' instead of 'sig' keyword; cleans up new features a bit 2016-02-29 12:19:54 +01:00
Andreas Rumpf
38dee2095c added 'sig' feature; removed tfShared support in the compiler 2016-02-28 19:56:41 +01:00
Andreas Rumpf
a4aeb6fbec implements final version of multiline comments 2016-01-17 20:29:50 +01:00
Andreas Rumpf
2e71bd50b2 implements multi-line-comments; pounds are stripped from the doc comments 2016-01-16 21:40:54 +01:00
pdw
7616790515 lib/packages/docutils - Dropped 'T' from types 2015-06-04 13:17:10 +02:00
Araq
f6ff01572e breaking change: 'concept' is now a keyword and used instead of 'generic' 2015-03-23 13:10:18 +01:00
Araq
85cc5a6a1f destuctors are experimental; 'func' is now a keyword 2014-12-10 01:57:08 +01:00
Araq
e27ab36731 implements 'defer' 2014-12-04 10:12:32 +01:00
Araq
0c25f7e202 support nimrod as an alias for nim for compatibility (nimforum!) 2014-09-17 02:37:05 +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
Araq
057b53e139 'lambda' is no keyword anymore 2014-08-08 02:24:19 +02:00
Araq
b961e47bfe new concurrency model: first steps; shared is not a keyword anymore 2014-04-14 08:45:43 +02:00
Charlie Barto
a79579da6f added an overload for highlight.initGeneralTokenizer that accepts a cstring.
I use this when calling the highlighter from C#.
2014-02-26 22:25:02 -05:00
EXetoC
446ffb5481 Punctation -> punctuation. 2014-01-29 02:29:25 +01:00
Araq
73c6efdf66 'nil' as a statement is deprecated, use an empty 'discard' instead 2014-01-19 16:54:59 +01:00
Araq
438703f59e case consistency: next steps 2013-12-29 01:13:51 +01:00
Araq
92b8fac94a case consistency part 4 2013-12-27 23:10:36 +01:00
Araq
c0a3d44060 bugfix: keywords are sorted 2013-12-05 10:45:36 +01:00