summary refs log tree commit diff stats
path: root/tools/kochdocs.nim
Commit message (Collapse)AuthorAgeFilesLines
* build documentation for `htmlparser` (#22879)ringabout2023-10-271-1/+4
| | | | | | I have added a note for installment https://github.com/nim-lang/htmlparser/pull/5 > In order to use this module, run `nimble install htmlparser`.
* fixes #22441; build documentation for more modules in the checksums (#22453)ringabout2023-08-171-0/+3
| | | Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* build atlas documentation (#22071)ringabout2023-06-111-1/+7
|
* Remove Deprecated Nimfix (#22062)Juan Carlos2023-06-101-2/+1
| | | | * Remove Deprecated Nimfix * Trailing whitespace cleanups
* clean up SOME pending/xxx/issue link comments (#21826)metagn2023-05-111-8/+3
| | | | | * clean up SOME pending/xxx/issue link comments * great
* build documentation for `checksums/md5` and `checksums/sha1` (#21791)ringabout2023-05-041-1/+5
| | | | | * build documentation for md5 and sha1 * fixes documentation reference
* fixes #19863; move sha1, md5 to nimble packages for 2.0 (#21702)ringabout2023-05-021-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move sha1, md5 to nimble packages * boot the compiler * fixes tests * build the documentation * fixes docs * lol, I forgot koch.nim * add `nimHasChecksums` define * clone checksums but maybe copying is better * bump nimble hash * use ChecksumsStableCommit * fixes tests * deprecate them * fixes paths * fixes koch
* docgen: implement cross-document links (#20990)Andrey Makarov2023-01-041-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * docgen: implement cross-document links Fully implements https://github.com/nim-lang/RFCs/issues/125 Follow-up of: https://github.com/nim-lang/Nim/pull/18642 (for internal links) and https://github.com/nim-lang/Nim/issues/20127. Overview -------- Explicit import-like directive is required, called `.. importdoc::`. (the syntax is % RST, Markdown will use it for a while). Then one can reference any symbols/headings/anchors, as if they were in the local file (but they will be prefixed with a module name or markup document in link text). It's possible to reference anything from anywhere (any direction in `.nim`/`.md`/`.rst` files). See `doc/docgen.md` for full description. Working is based on `.idx` files, hence one needs to generate all `.idx` beforehand. A dedicated option `--index:only` is introduced (and a separate stage for `--index:only` is added to `kochdocs.nim`). Performance note ---------------- Full run for `./koch docs` now takes 185% of the time before this PR. (After: 315 s, before: 170 s on my PC). All the time seems to be spent on `--index:only` run, which takes almost as much (85%) of normal doc run -- it seems that most time is spent on file parsing, turning off HTML generation phase has not helped much. (One could avoid it by specifying list of files that can be referenced and pre-processing only them. But it can become error-prone and I assume that these linke will be **everywhere** in the repository anyway, especially considering https://github.com/nim-lang/RFCs/issues/478. So every `.nim`/`.md` file is processed for `.idx` first). But that's all without significant part of repository converted to cross-module auto links. To estimate impact I checked the time for `doc`ing a few files (after all indexes have been generated), and everywhere difference was **negligible**. E.g. for `lib/std/private/osfiles.nim` that `importdoc`s large `os.idx` and hence should have been a case with relatively large performance impact, but: * After: 0.59 s. * Before: 0.59 s. So Nim compiler works so slow that doc part basically does not matter :-) Testing ------- 1) added `extlinks` test to `nimdoc/` 2) checked that `theindex.html` is still correct 2) fixed broken auto-links for modules that were derived from `os.nim` by adding appropriate ``importdoc`` Implementation note ------------------- Parsing and formating of `.idx` entries is moved into a dedicated `rstidx.nim` module from `rstgen.nim`. `.idx` file format changed: * fields are not escaped in most cases because we need original strings for referencing, not HTML ones (the exception is linkTitle for titles and headings). Escaping happens later -- on the stage of `rstgen` buildIndex, etc. * all lines have fixed number of columns 6 * added discriminator tag as a first column, it always allows distinguish Nim/markup entries, titles/headings, etc. `rstgen` does not rely any more (in most cases) on ad-hoc logic to determine what type each entry is. * there is now always a title entry added at the first line. * add a line number as 6th column * linkTitle (4th) column has a different format: before it was like `module: funcName()`, now it's `proc funcName()`. (This format is also propagated to `theindex.html` and search results, I kept it that way since I like it more though it's discussible.) This column is what used for Nim symbols resolution. * also changed details on column format for headings and titles: "keyword" is original, "linkTitle" is HTML one * fix paths on Windows + more clear code * Update compiler/docgen.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> * Handle .md and .nim paths uniformly in findRefFile * handle titles better + more comments * don't allow markup overwrite index title for .nim files Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* build the documentation of official packages (#20986)ringabout2022-12-061-17/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove db stuffs * remove punycode * remove * fixes script * add cloner * patches * disable * patch * fixes external packages * disable two packages * preview documentation build * try again * fixes URL * fixes a bug * simplify * fixes documentaion * fixes * Apply suggestions from code review
* koch remove dead code (#20912)Juan Carlos2022-11-251-9/+2
| | | | | | | * koch remove dead code for Travis CI * Restart CI * Restart CI
* removes channels_builtin when enabling `nimPreviewSlimSystem` (#20713)ringabout2022-10-311-11/+1
|
* move threads out of system (#20674)ringabout2022-10-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move syslocks first * progress * clean up * go on * clean up * clean up * add imports syslocks * remove documentation * public deallocOsPages * fixes genode * fixes more * fixes boehmGC * cover more cases * fixes cyclic deps * fixes genode * cleanup * unpublic fields * cleanup * clean up
* move widestrs out of system (#20462)metagn2022-10-011-1/+0
| | | | | * move widestrs out of system * fix osproc
* add plausibleAnalytics support for koch docs[backport:1.6] (#20454)ringabout2022-09-301-0/+1
| | | add plausibleAnalytics to koch docs[backport:1.6]
* make koch and tools work with `nimPreviewSlimSystem` (#20459)ringabout2022-09-301-1/+5
|
* moderate system cleanup & refactor (#20355)metagn2022-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * system refactor, move out 600 lines * compilation, slice, backwardsindex, misc_num moved out of system * some procs/types moved into arithmetics, basic_types * system no longer depends on syncio * some procs moved around to fit with their surroundings * make exceptions an import, old ops to misc_num * move instantiationInfo back * move back nim version, fix windows echo * include compilation * better docs for imported modules, fix unsigned ops also remove ze, ze64, toU8, toU16, toU32 with nimPreviewSlimSystem * fix terminal * workaround IC test & weird csize bug, changelog * move NimMajor etc back to compilation, rebase for CI * try ic fix * form single `indices`, slim out TaintedString, try fix IC * fix CI, update changelog, addQuitProc * fix CI * try fix CI * actually fix CI finally hopefully * Update lib/system/compilation.nim Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * update kochdocs * hopefully fix csize uses for slimsystem * fix tquit Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* fix `nim md2tex` and `koch pdf` commands (#20280)Andrey Makarov2022-08-281-11/+11
| | | | | * fix `nim md2tex` and `koch pdf` commands * change rst2tex -> md2tex also
* Improve Markdown code blocks & start moving docs to Markdown style (#19954)Andrey Makarov2022-07-151-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Remove define for jsfetch (#19530)Juan Carlos2022-02-251-1/+1
| | | | | | | | | * Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch * Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch * Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch * Remove define nimExperimentalAsyncjsThen for std/asyncjs.then and std/jsfetch
* move io out of system (#19442)flywind2022-02-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * move io out of system * fix tests * fix tests * next step * rename to syncio * rename * fix nimscript * comma * fix * fix parts of errors * good for now * fix test
* renamed 'gc' switch to 'mm'; [backport:1.6] (#19187)Andreas Rumpf2021-11-241-1/+1
| | | | * renamed 'gc' switch to 'mm'; [backport:1.6] * better docs
* fix nimindexterm in rst2tex/doc2tex [backport] (#19106)Andrey Makarov2021-11-091-0/+6
| | | | | * fix nimindexterm (rst2tex/doc2tex) [backport] * Add support for indexing in rst
* docstyle.rst: Do not export it to HTML as a standalone doc (#19083)Kaushal Modi2021-11-021-1/+4
| | | | | .. This doc is included in contributing.rst. Fixes https://github.com/nim-lang/Nim/issues/14593.
* Fixed `strictFuncs` support for `std/pegs` (#18951)quantimnot2021-10-071-3/+8
| | | | | | | | | | | | | | | | | * Fixed `strictFuncs` support for `std/pegs` Enabled `std/pegs` in the `strictFuncs` import test. Fixes #18057 Fixes #16892 See #18111 * Rebased from `devel` * Conditionally compile `std/pegs` in `koch` This is for supporting `csources` bootstrap. Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* Implement RFC-391 (#18585)Juan Carlos2021-08-221-1/+1
|
* `./koch tools` now builds bin/nim_dbg, a debug version of nim (#18289)Timothee Cour2021-06-281-2/+3
|
* docs now show nimExperimentalX APIs (#18345)Timothee Cour2021-06-251-1/+2
| | | | | * docs now show nimExperimentalX APIs * fix for windows
* docs: Latex generation improvements (#18141)Andrey Makarov2021-06-011-7/+7
| | | | | | | * docs: improve Latex generation * make it work on Windows + fix ] escaping * minor fixes with escapes and style
* follow up #17276 (#17355)flywind2021-03-191-1/+1
| | | | | | | | | | | | | * improve test coverage for isolation * a bit better * rename channels to channels_builtin * follow up #17276 * fix * Update lib/std/private/jsutils.nim
* rename channels to channels_builtin (#17330)flywind2021-03-121-1/+1
| | | | | | | * improve test coverage for isolation * a bit better * rename channels to channels_builtin
* Add module jsfetch (#12531)Juan Carlos2021-03-061-1/+1
| | | | | | | | | | | | * Add module jsfetch for fetch support for JavaScript target https://developer.mozilla.org/docs/Web/API/Fetch_API * Update lib/std/jsheaders.nim * Update lib/std/jsformdata.nim * Update lib/std/jsfetch.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: flywind <xzsflywind@gmail.com>
* remove tests/deps/ (#17132)Timothee Cour2021-02-231-1/+2
| | | | | | | | | * remove tests/deps/ * fix tests * fix tests/manyloc/keineschweine/lib/zlib_helpers.nim * fixup
* fix prelude regression refs #16238: `include prelude` doesn't interfere with ↵Timothee Cour2021-02-221-1/+0
| | | | | | | | | `nim doc` (#17111) * fix bug1 from #16238 nim doc now works with include prelude * fix for windows * fixup
* move prelude so that `include std/prelude` also works (#17110)Timothee Cour2021-02-201-1/+1
| | | | | * move prelude so that `include std/prelude` also works * add test
* unbundle fusion (#16925)Timothee Cour2021-02-111-1/+1
| | | | | | * unbundle fusion * changelog * address comment: `./koch fusion` calls nimble install fusion (at a fixed hash)
* improve ./koch docs (#16991)Timothee Cour2021-02-101-27/+24
| | | | | | | * improve ./koch docs * fixup * fixup
* fix ./koch pdf command (#16989)Andrey Makarov2021-02-091-17/+20
|
* Add js BigInts (#16409)Juan Carlos2021-01-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | * Add BigInts * Renames tos plurals * Improve Stringifications * Update changelog.md Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com> * RunnableExamplerize * discard the discardable pragma * Several improvements from peer reviews, more docs * More doc, more test * More doc, more test * Better error message 'Error: usage of low is an {.error.} defined at jsbigints.nim' instead of just 'type mismatch JsBigInt' * is an overload, rename * proc to scare kids away * Update lib/js/jsbigints.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * https://github.com/nim-lang/Nim/pull/16409#discussion_r554365041 Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* skip docs for `lib/fusion` (docs already run in fusion repo) (#16645)Timothee Cour2021-01-081-4/+3
| | | | | * run CI docs on koch.nim changes to avoid future regressions * kochdocs: skip lib/fusion
* kochdocs: fusion needs the js backend too (#16644)alaviss2021-01-081-1/+3
|
* clean up the docs of some modules under lib/js (#16579)flywind2021-01-041-1/+0
|
* remove all mentions of doc2, jsondoc2 (except 1 mentioning the alias) (#15683)Timothee Cour2020-11-261-1/+1
|
* remove iup from stdlib in contrast to #15828 (#15830)flywind2020-11-031-1/+0
| | | | | * remove iup from stdlib * Update changelog.md
* Fix #15183 (#15300)Juan Carlos2020-09-111-1/+0
|
* Changes for FreeRTOS/LwIP Port for the ESP32 (ESP-IDF) (#15250)Jaremy Creechley2020-08-311-0/+1
| | | | | | | | | | | | | | | | | | | * Changes for FreeRTOS/LwIP Port for the ESP32 (ESP-IDF) Adding FreeRTOS/LwIP to compiler: * adding freertos option * dyncalls for freertos * add freertos to posix os list * adding lwip option Setting up networking FreeRTOS/LwIP Port: * setting up lwip network for freertos * fixing posix / networking for freertos * disable setInheritable for freerots * using lwip for net control items * Fix builds by ignoring lib/posix/posix_freertos_consts.nim similar to lib/posix/posix_other_consts.nim
* fix nightlies: smaller log files (#15074)Miran2020-07-251-1/+1
| | | | Hopefully this will fix "The job exceeded the maximum log length, and has been terminated."
* jsre: try to fix nightlies (#15057)Miran2020-07-241-1/+2
|
* Add jsre (#14870)Juan Carlos2020-07-031-2/+5
|
* {.deprecated: [existsFile: fileExists].} (#14735)Timothee Cour2020-07-021-3/+3
| | | | | | | | | * {.deprecated: [existsFile: fileExists].} * s/existsFile/fileExists/ except under deps * workaround pending #14819 * fix test
* koch: add --localdocs to allow building only local docs (#14783)alaviss2020-06-251-5/+18
| | | | | | | | | | | | | | | | | | | * koch: add --localdocs to allow building only local docs This flag also make koch doc use the passed arguments when building the offline docs. This is useful when generating nightlies as we would want to use --doccmd:skip and also skipping a pass of docgen speed things up drastically (for non-native targets). This flag superseded the undocumented --docslocal. * kochdocs: filter google analytics code from the arg list instead This commit introduce a small PEG expression to filter out the google analytics code before building local docs when --localdocs is not specified. This lets us keep any arguments unrelated to google analytics when building local docs, useful for use with --doccmd:skip