Skip to content

Commit

Permalink
add documentation for html development
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed Nov 28, 2024
1 parent 3e9d705 commit e507c34
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,27 @@ $ deno task build
$ deno task test
```

### HTML generation

If you want to work on the HTML generation aspect of deno_doc, these things will
help you:

`deno task tailwind`: this regenerates the transpiled tailwind from the css
files and mentions of classes across the codebases, be it in rust files or js
files. This needs to always be run to do any updates to the styling.

`deno task gen_html`: This generates a `generated_docs` directory which is the
HTML output based on the provided files.

`deno task debug`: this calls the above tailwind task, and then the gen_html
task with all the files from `tests/testdata/multiple` passed.

We recommend to use these tasks above to develop features or debug things,
rather than recompiling a dependent on this system, as it is much faster
iteration and easier to debug.

We use [insta](https://github.com/mitsuhiko/insta) testing tool for taking
snapshots of the html output. If you change the rednering of html output, or
snapshots of the html output. If you change the rendering of html output, or
change the fixture files for html testing, you need to update snapshot using
[cargo-insta](https://insta.rs/docs/quickstart/) command.

Expand Down
3 changes: 2 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"build": "cp LICENSE js/LICENSE && deno run -A jsr:@deno/[email protected] --project deno_doc_wasm --out js",
"test": "deno test -A",
"tailwind": "deno run -A build_css.ts",
"gen_html": "deno task tailwind && cargo run --example ddoc -- --name=Test --html ./tests/testdata/multiple/* --output generated_docs/",
"gen_html": "cargo run --example ddoc -- --name=gen_html --output generated_docs/ --html",
"debug": "deno task tailwind && deno task doc ./tests/testdata/multiple/*",
"test:update": "UPDATE=1 cargo test --locked --all-targets && cargo insta test --accept"
},
"workspace": ["js"],
Expand Down

0 comments on commit e507c34

Please sign in to comment.