about summary refs log tree commit diff
path: root/src/etc/htmldocck.py
AgeCommit message (Collapse)AuthorLines
2025-09-03htmldocck: fix a bug in relative paths / globsMichael Howell-1/+1
This bug only shows up when you run htmldocck in a directory other than outdir, and also use globs. Never happened before, which is why we're only seeing it now.
2025-08-15rustdoc-search: search backend with partitioned suffix treeMichael Howell-0/+6
2025-07-13Compiletest: Simplify {Html,Json}DocCk directive handlingLeón Orell Valerian Liehr-47/+8
2025-07-11htmldocck: better error messages for negative raw directivesbinarycat-0/+4
2025-06-04Add link to correct documentation in htmldocck.pyDerukugi-114/+2
Fix typo in src/etc/htmldocck.py Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> Change documentation link to the correct section in src/etc/htmldocck.py Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> Remove all top-level docs from htmldocck.py
2025-03-01htmldocck: catch and error on deprecated syntaxYotam Ofek-0/+14
2024-12-04Reformat Python code with `ruff`Jakub Beránek-109/+151
2024-10-29Rename `command-list.rs` to `directive-list.rs`Zalathar-1/+1
2024-07-19Update jsondocck directives to follow ui_test-styleLeón Orell Valerian Liehr-0/+1
2024-06-24Allow numbers in rustdoc tests commandsGuillaume Gomez-1/+1
2024-06-24Remove commands duplication between `compiletest` and `tests/rustdoc`Guillaume Gomez-225/+28
2024-06-24Move `tests/rustdoc` testsuite to `//@` syntaxGuillaume Gomez-32/+249
2023-07-19Improve htmldocck error a bit by providing line where error occurredGuillaume Gomez-0/+2
2023-06-23Add @files commandGuillaume Gomez-3/+51
2023-06-16Apply changes to fix python linting errorsTrevor Gross-3/+5
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-13Fix line lengthsNoah Lev-3/+7
2022-08-13Rename `@hastext` to `@hasraw` (same for `matches`)Noah Lev-7/+7
I think `@hasraw` is slightly clearer than `@hastext` since it is actually matching against the raw HTML, not the text nodes.
2022-08-13Rename `@{has,matches}-literal` to `...text`Noah Lev-7/+7
Reasons: 1. It's shorter. 2. `@matches-literal` seems to contradict itself: a regex is intrinsically not a literal match, while it is still a textual match.
2022-08-13Use different name for arity-2 `@has` and `@matches`Noah Lev-9/+9
See #100354 for the rationale.
2022-07-26Htmldocck: Substitute the doc channel when blessingLeón Orell Valerian Liehr-0/+1
2022-06-18Fix bug when using `--bless`Michael Howell-3/+1
2022-06-06Rollup merge of #90905 - GuillaumeGomez:empty-impl-blocks, r=jshaMatthias Krüger-16/+31
Add empty impl blocks if they have documentation Fixes https://github.com/rust-lang/rust/issues/90866. The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with https://github.com/rust-lang/rust/pull/89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc ```@Mark-Simulacrum).``` It looks like this: ![Screenshot from 2021-11-14 16-51-28](https://user-images.githubusercontent.com/3050060/141689100-e57123c0-bf50-4c42-adf5-d991e169a0e4.png) cc ```@jyn514``` r? ```@camelid```
2022-06-02rustdoc: add channel normalization to htmldocck.pyMichael Howell-0/+2
2022-05-31Update test script for src/test/rustdoc to allow to add a filter for the ↵Guillaume Gomez-16/+31
@count command
2022-04-17Fix --bless not working anymore in htmldocckLoïc BRANSTETT-1/+5
2022-04-16htmldocck: Compare HTML tree instead of plain text htmlLoïc BRANSTETT-4/+66
2022-01-15htmldocck: Add support for `/text()` in `@snapshot`Noah Lev-3/+11
This allows just testing the text, in cases where the HTML tags don't matter.
2021-12-01Implement `@snapshot` check for htmldocckNoah Lev-4/+76
This form of check allows performing snapshot tests (à la `src/test/ui`) on rustdoc HTML output, making it easier to create and update tests. See this Zulip thread [1] for more information about the motivation for this change. [1]: https://zulip-archive.rust-lang.org/stream/266220-rustdoc/topic/HTML.20snapshot.20tests.html#262651142
2021-06-04rustdoc: link to stable/beta docs consistently in documentationJoshua Nelson-0/+4
## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel
2021-01-03Detect invalid rustdoc test commandsGuillaume Gomez-1/+11
2020-07-26python codes cleanupjnozsc-4/+4
2020-06-08Fallback to xml.etree.ElementTreeTomasz Miąsko-1/+4
The xml.etree.cElementTree has been deprecated since Python 3.3 and removed in Python 3.9 https://bugs.python.org/issue36543.
2020-02-08PEP8 format spacing, remove unnecessary local variable assignmentChris Simpkins-14/+26
2019-01-06use utf-8 throughout htmldocckAndy Russell-18/+28
This commit improves compatibility with Python 3, which already uses Unicode throughout. It also fixes a subtle incompatibility stemming from the use of `entitydefs`, which contains replacement text _encoded in latin-1_ for HTML entities. When using Python 3, this would cause `0xa0` to be incorrectly added to the element tree. This meant that there was a rustdoc test that would pass under Python 2 but fail under Python 3, due to an incorrect regex match against the non-breaking space character. This commit triggers that failure in both versions, and also fixes it.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-10-11Fix spelling in the documentation to htmldocck.pyPhilip Munksgaard-25/+27
2018-06-04slightly improve rustdoc xml path errorGuillaume Gomez-9/+13
2017-09-30let htmldocck.py check for directoriesQuietMisdreavus-0/+18
2017-08-26Allow htmldocck to run using Python 3.kennytm-13/+20
2016-05-30print enum variant fields in docsOliver Schneider-0/+1
2016-04-22Only record the same impl oncemitaa-3/+6
Due to inlining it is possible to visit the same module multiple times during `<Cache as DocFolder>::fold_crate`, so we keep track of the modules we've already visited.
2015-12-10Improve `htmldocck.py` error messagesmitaa-54/+86
2015-04-07rustdoc: Add a primitive page for raw pointersAlex Crichton-1/+2
Closes #15318
2015-02-27Add a way to assert the number of occurrences to htmldocckSeo Sanghyeon-0/+15
2015-01-27Fix PEP8 for htmldocckRicho Healey-15/+45
2015-01-18tests: Warn on the trailing backslash in the template.Kang Seonghoon-0/+3
2015-01-18tests: Tidy and allows multi-line htmldocck commands.Kang Seonghoon-3/+35
2015-01-18tests: Add htmldocck.py script for the use of Rustdoc tests.Kang Seonghoon-0/+316
The script is intended as a tool for doing every sort of verifications amenable to Rustdoc's HTML output. For example, link checkers would go to this script. It already parses HTML into a document tree form (with a slight caveat), so future tests can make use of it. As an example, relevant `rustdoc-*` run-make tests have been updated to use `htmldocck.py` and got their `verify.sh` removed. In the future they may go to a dedicated directory with htmldocck running by default. The detailed explanation of test scripts is provided as a docstring of htmldocck. cc #19723