summary refs log tree commit diff stats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* fixes warnings when building csources (#21194)ringabout2022-12-281-6/+6
| | | | | * replace `symbolfiles` with `incremental`; fixes warnings when build csources * fixes self conversion warnings
* atlas: minor doc improvements (#21183)Andreas Rumpf2022-12-271-1/+5
| | | | | * closes #20808 * atlas: better docs
* Make search results be relative to documentation root (#21145)Jake Leahy2022-12-231-18/+30
| | | Use Nim instead of JS for searching
* ucpu fix-up for arm64 value on macos m1 (#21142)Luca Guzzon2022-12-201-0/+3
|
* csource building prefers `bin/nim` (#21115)ringabout2022-12-161-2/+13
|
* build the documentation of official packages (#20986)ringabout2022-12-062-17/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Add HPPA and sparc64 architectures (#20934)Federico Ceratto2022-12-011-0/+7
| | | | | | | | | | | * Add comments on CPU arch detection * Support HPPA/hppa/parisc64 CPU architecture * Support sparc64 CPU architecture * Update tools/niminst/makefile.nimf Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Support IBM Z architecture (#20943)Federico Ceratto2022-11-281-0/+3
|
* Handle ppc CPU architecture (#20920)Federico Ceratto2022-11-261-1/+1
| | | | | | | | | | * Remove confusing "ppc" block The PowerPC arch is called "powerpc" in platforms.nim The makefile shipped in release 1.6.10 populates the oFiles variable when myos=linux and mycpu=powerpc mycpu=ppc instead leads to ``no C code generated for: [linux: ppc]. Stop`` * Handle ucpu=ppc
* koch remove dead code (#20912)Juan Carlos2022-11-251-9/+2
| | | | | | | * koch remove dead code for Travis CI * Restart CI * Restart CI
* Fix #14476 (#20878)Jake Leahy2022-11-211-1/+1
| | | | | | | * Use link from webpage. Closes #14476 * Update doc generation tests * Update RST test
* 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
* Fix #20628 for Windows (#20667)Andrey Makarov2022-10-281-1/+1
| | | | | | | * Fix #20628 for Windows * Move isRegular - !isSpecial and onlyRegular - skipSpecial * Forgot to change it in 1 more place
* Implement Unix file regularity check (#20448) (#20628)Andrey Makarov2022-10-251-1/+1
| | | | | * Implement Unix file regularity check * update std/dirs also
* fixes niminst with stricteffects; add testcase for niminst (#20587)ringabout2022-10-182-1/+12
| | | fixes niminst with stricteffects; add testcase
* Validate `nimgrep` filter options not empty (#20562)Andrey Makarov2022-10-141-13/+19
|
* Atlas: added an explicit --workspace option (#20532)Andreas Rumpf2022-10-101-3/+15
|
* implemented 'atlas install' command (#20530)Andreas Rumpf2022-10-101-52/+90
|
* 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-303-3/+13
|
* 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>
* remove deprecated and broken nimweb tools (#20442)ringabout2022-09-282-822/+0
| | | | | * remove deprecated and broken nimweb tools * readme
* nimgrep: add `--inContext` and `--notinContext` options (#19528)Andrey Makarov2022-09-141-71/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | * nimgrep: add `--matchContext` and `--noMatchContext` options * Rename options for uniformity * Revise option names, add `--parentPath` options * Revert --bin deprecation * Copy-paste an original test from quantimnot The origin was: https://gist.githubusercontent.com/quantimnot/5d23b32fe0936ffc453220d20a87b9e2/raw/96544656d52332118295e55aa73718c389e5d194/tnimgrep.nim * Change ! to n * Attempt to fix test * Fix test on Windows * Change --contentsFile -> --inFile, add more tests * Bump * Change --parentPath to --dirpath
* Cleanup dochack (#20299)Amjad Ben Hedhili2022-09-041-88/+36
| | | | | | | * Cleanup dochack * xxx * More cleanups
* remove deprecated type pragma syntax, fix bugs that required it (#20199)metagn2022-09-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | * remove deprecated pragma syntax from 0.20.0 closes #4651, closes #16653 with a cheap fix for now due to how early `tfFinal` is set * remove type pragma between name and generics * undo removal, try removing bind expression (0.8.14) * fix test, unremove bind expr * remove again * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * dependencies @ HEAD & weave test dependencies * try fix package ci Co-authored-by: konsumlamm <44230978+konsumlamm@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
* Docs auto dark mode (#20188)Amjad Ben Hedhili2022-08-211-26/+14
| | | | | | | | | | | | | * Implement auto dark mode * Rename class * Fix borders cutout * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* make sure tools/heapdumprepl.nim continues to compile (#20146)ringabout2022-08-191-4/+2
|
* make implicit cstring conversions explicit (#19488)ee72022-08-191-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nim manual says that an implicit conversion to cstring will eventually not be allowed [1]: A Nim `string` is implicitly convertible to `cstring` for convenience. [...] Even though the conversion is implicit, it is not *safe*: The garbage collector does not consider a `cstring` to be a root and may collect the underlying memory. For this reason, the implicit conversion will be removed in future releases of the Nim compiler. Certain idioms like conversion of a `const` string to `cstring` are safe and will remain to be allowed. And from Nim 1.6.0, such a conversion triggers a warning [2]: A dangerous implicit conversion to `cstring` now triggers a `[CStringConv]` warning. This warning will become an error in future versions! Use an explicit conversion like `cstring(x)` in order to silence the warning. However, some files in this repo produced such a warning. For example, before this commit, compiling `parsejson.nim` would produce: /foo/Nim/lib/pure/parsejson.nim(221, 37) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] /foo/Nim/lib/pure/parsejson.nim(231, 39) Warning: implicit conversion to 'cstring' from a non-const location: my.buf; this will become a compile time error in the future [CStringConv] This commit resolves the most visible `CStringConv` warnings, making the cstring conversions explicit. [1] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/doc/manual.md#cstring-type [2] https://github.com/nim-lang/Nim/blob/d2318d9ccfe6/changelogs/changelog_1_6_0.md#type-system
* Build compiler with --noNimblePath (#20168)Ivan Yonchovski2022-08-091-1/+1
| | | - Fixes https://github.com/nim-lang/Nim/issues/18840
* niminst: support DESTDIR and quote variables (#20051)Anna2022-07-181-42/+45
| | | | | * niminst: support DESTDIR (fix #9788) * niminst: quote variables
* 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
* Enable nim-lang to build correctly on illumos-based systems (#19952)Sam Zaydel2022-06-301-1/+1
|
* Extend and document compiler debugging utilities (#19841)quantimnot2022-06-102-0/+79
| | | | | | | | | * Add two debugutils procs that native debuggers can break on use to execute commands when code of interest is being compiled. * Add GDB and LLDB programs to disable and enable breakpoints and watchpoints when code of interest is being compiled. * Extend the `intern.rst` docs regarding debugging the compiler. Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* Always use httpclient in nimgrab (#19767)Yardanico2022-05-172-459/+9
|
* rewrite docs JS in Nim (#19701)flywind2022-04-091-1/+35
| | | | | | | * rewrite docs JS in Nim * fixup * fix nimdoc/rsttester
* Fix CPU detection for i386 (#19577)VlkrS2022-03-031-1/+1
| | | | | | | | | | * Fix CPU detection for i386 Commit 787def271b1cabc6f898caa42f892125de9fa908 breaks CPU detection for i386 on OpenBSD and probably on other platforms. [ isOpenIndiana -eq "yes" ] always returns 0, so mycpu is always set to "amd64". * Update buildsh.nimf Fix accidental bashism
* 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
* Improve Zshell completion (#19354)Andrey Makarov2022-01-181-144/+114
|
* Fix build on FreeBSD/powerpc (#19282)pkubaj2021-12-221-2/+4
| | | It's currently misdetected as powerpc64.
* Add icon for Nim (#19258)snxx2021-12-173-0/+0
| | | | | | | * Add Nim's file icon * Add installer icon * Add uninstaller icon
* Add support for LoongArch (#19223)wenghongquan2021-12-093-0/+6
| | | | | | | * Add support for LoongArch * Update compiler/installer.ini Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* 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.
* Docs: change clipboard cursor type to `pointer` (#19064)ynfle2021-10-281-1/+2
|