summary refs log tree commit diff stats
path: root/nimdoc/test_out_index_dot_html/expected
Commit message (Collapse)AuthorAgeFilesLines
* Prevent font flashing in the docs (#23622)Nils Lindemann2024-05-272-6/+8
| | | | | | | | | | ... by moving the Google font includes near the top of the head. By including them as early as possible, they are known, when the browser starts rendering the body. Test it by making the change manually in `doc/html/system.html` and then press ctrl+f5 (reload without cache). This removes the font flashing. Tested in Chrome and Firefox.
* Make `data-theme` default to "auto" in HTML (#23222)Jake Leahy2024-01-192-2/+2
| | | | | | | | | Makes docs default to using browser settings instead of light mode This should fix #16515 since it doesn't require the browser to run the JS to set the default Also means that dark mode can be used without JS if the browser is configured to default to dark mode
* fix #22492 (#22511)Hamid Bluri2023-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * fix #22492 * Update nimdoc.css remove scroll-y * Update nimdoc.out.css * Update nimdoc.css * make it sticky again * Update nimdoc.out.css * danm sticky, use fixed * Update nimdoc.out.css * fix margin * Update nimdoc.out.css * make search input react to any change (not just keyboard events) according to https://github.com/nim-lang/Nim/pull/22511#issuecomment-1685218787
* docgen: implement cross-document links (#20990)Andrey Makarov2023-01-042-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix #14476 (#20878)Jake Leahy2022-11-211-1/+1
| | | | | | | * Use link from webpage. Closes #14476 * Update doc generation tests * Update RST test
* move google fonts to the last part (#20541)ringabout2022-10-112-8/+6
| | | | | | | * move google fonts to the last part * fixes tests * fix rst2html
* fixes #20524; add forbids pragmas to hideable lists (#20525)ringabout2022-10-091-1/+1
| | | | | * fixes #20524; add forbids pragmas to hideable lists * fixes nimdoc
* Docs auto dark mode (#20188)Amjad Ben Hedhili2022-08-211-6/+7
| | | | | | | | | | | | | * 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>
* .forbids pragma: defining forbidden tags (#20050)Lancer112112022-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .forbids pragma: defining illegal effects for proc types This patch intends to define the opposite of the .tags pragma: a way to define effects which are not allowed in a proc. * updated documentation and changelogs for the forbids pragma * renamed notTagEffects to forbiddenEffects * corrected issues of forbids pragma the forbids pragma didn't handle simple restrictions properly and it also had issues with subtyping * removed incorrect character from changelog * added test to cover the interaction of methods and the forbids pragma * covering the interaction of the tags and forbids pragmas * updated manual about the forbids pragma * removed useless statement * corrected the subtyping of proc types using the forbids pragma * updated manual for the forbids pragma * updated documentations for forbids pragma * updated nim docs * updated docs with rsttester.nim * regenerated documentation * updated rst docs * Update changelog.md Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * updated changelog * corrected typo Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Fixes #19900 (#19906)Jake Leahy2022-06-191-1/+1
| | | Fixed tocRoot placement
* Keep the doc sidebar on the screen while scrolling (#19851)JJ2022-06-152-78/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [docgen] Group sidebar sections into <details> (open by default) * [docgen] Consistent indentation in generated HTML (this is a boon for working on docgen's html/css output) * [docgen] Move Source/Edit buttons inside main div This makes styling the documentation significantly easier. * [docgen] Somewhat consistent CSS formatting * [docgen] Keep the sidebar onscreen while scrolling * [docgen] Tweak CSS for the sticky sidebar * [docgen] search type=text ==> type=search * [docgen] Update expected doc output * [docgen] Fix Group by Type sidebar placement bug * [docgen] Curse you, whitespace (fix tests) * [docgen] Fix rst2html tests Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
* rewrite docs JS in Nim (#19701)flywind2022-04-092-86/+0
| | | | | | | * rewrite docs JS in Nim * fixup * fix nimdoc/rsttester
* docgen: implement doc link resolution in current module (#18642)Andrey Makarov2021-10-281-0/+4
|
* we need something better than warningAsError for effect handling viol… ↵Andreas Rumpf2021-09-041-1/+1
| | | | | | (#18796) * we need something better than warningAsError for effect handling violations
* strict effects (#18777)Andreas Rumpf2021-09-021-1/+1
| | | | | | | | | | | | | | | | | * fixes #17369 * megatest is green for --cpu:arm64 * docgen output includes more tags/raises * implemented 'effectsOf' * algorithm.nim: uses new effectsOf annotation * closes #18376 * closes #17475 * closes #13905 * allow effectsOf: [a, b] * added a test case * parameters that are not ours cannot be declared as .effectsOf * documentation * manual: added the 'sort' example * bootstrap with the new better options
* docgen: draw frame around active anchors (#18607)Andrey Makarov2021-07-291-1/+2
|
* Fix JS error on index page and detect dark mode (#18191)drtheuns2021-06-072-8/+18
| | | | | | | | | | | | | | | | * Fix JS error on index page and detect dark mode The theindex.html page doesn't have a dark mode switch so the main function will error because `toggleSwitch` is not defined. Checks have been added to prevent this from happening. Also add automatic detection of system settings for dark-mode. This could also be done with pure css, but then the dark mode variable declarations would have to be duplicated to work with the switch so I went with this approach. * Fix nimdoc tests * Fix rst2html tests
* docgen: render pragmas by default except for a select list (and fix #9074) ↵Timothee Cour2021-04-011-1/+1
| | | | (#17054)
* fix #16973 ; nim doc now shows correct, canonical import name in title (#16999)Timothee Cour2021-03-231-2/+2
| | | | * nim doc now shows correct import name in title
* fix #9102 docgen: sidebar now shows proc signatures instead of encoding (#16857)Timothee Cour2021-01-291-1/+1
|
* nimdoc: Initialize theme switch and pragma dots on DOMContentLoaded (#16247)Sebastian Reinhard2020-12-062-2/+6
| | | | | | | | | The default HTML template for nimdoc currently initializes the dark mode switch and pragma dots when the onload event is fired. But since the onload event does not fire until all external resources (images, stylesheets, fonts, etc.) have been loaded, the light theme is shown for a brief moment before the document is fully loaded, and it switches to the dark theme. This is quite jarring, especially on slower internet connections. So let's instead initialize these things on the DOMContentLoaded event, which is fired right after the document has been parsed and the initial DOM structure is ready. This means that we now display the dark mode immediately, without having to wait for external resources to load first. For reference, see: - https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event - https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMContentLoaded_event I have updated the snapshot tests in `nimdoc/`, and done some manual testing of both the theme switch and the pragma dots, to confirm that this does not break anything. Please let me know if I've missed anything.
* [backport: 1.4] Better linebreaks (#15658)Miran2020-10-221-1/+1
|
* add Source+Edit links on top of every docgend file (#15642)Timothee Cour2020-10-221-0/+1
|
* group procs of the same name in TOC (#15487)Miran2020-10-051-1/+4
| | | | | | | | | | | * group procs of the same name in TOC * correctly show `sink` parameters in TOC * no need to reinvent the wheel - `mgetorPut` exists * better setting of text color [ci skip] * fix CSS for better alignment
* Fix theme switch load from local storage (#14897)Manuel Bojato2020-07-102-28/+10
| | | | | | | * fix theme switch load from local storage * Fix tests Co-authored-by: Clyybber <darkmine956@gmail.com>
* fix #6583, fix #14376, index+search now generated for all projects, many bug ↵Timothee Cour2020-05-251-0/+3
| | | | | | | | | fixes with nim doc (#14324) * refs #6583 fix nim doc output * changelog * change default for outDir when unspecified * cleanups * --project implies --index
* Fix docs (#13176)Clyybber2020-01-162-2/+2
|
* fixes #12998 nim doc regression (#13117)Timothee Cour2020-01-162-2/+2
|
* feature dracula themed doc (#12816)Andreas Rumpf2019-12-102-1534/+73
| | | | | | | | | | * Implement gorgeous Dracula themed Nim documentation * Add color for escape sequences * fixes the test cases * the big CSS cleanup
* Removing the mention of using `discard` for block comments (#12837) [backport]Elliot Waite2019-12-082-0/+2
| | | | | | * Remove mention of using `discard` for block comments * Add a 32x32 alternate favicon
* Implement some custom formatting for input fields in the documentation (#11632)Hugo Locurcio2019-07-032-0/+34
| | | | | | | | | | * Implement some custom formatting for input fields in the documentation Aside of resulting in more consistent appearance across browsers, this also fixes input form rendering when using Firefox with a dark system theme on Linux. * change the expected html in the tests
* Render deprecated pragmas (#8886)LemonBoy2019-06-031-0/+2
| | | | | | | | | * Render deprecated pragmas * fix the expected html * clean up the documentation regarding deprecations * fix typo * fix system.nim * fix random
* Use the correct HTML file reference in "nim doc" generated idx files (#11326)Kaushal Modi2019-05-253-0/+1659
* Use the correct HTML file reference in "nim doc" generated idx files Now "nim doc --out:foo.html --index:on bar.nim" generates "foo.html" and the generated "bar.idx" contains references to "foo.html". Fixes https://github.com/nim-lang/Nim/issues/11325. * Refactor the nim doc tester to extend it for more tests * Reference the HTML files relative to the outDir, not project dir * Add test for issues #11312 and #11325 - https://github.com/nim-lang/Nim/issues/11312 - https://github.com/nim-lang/Nim/issues/11325