Skip to content

Commit 8230fd7

Browse files
committed
tweak the docs for correctness
1 parent 6309c02 commit 8230fd7

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

docs/quickstart/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ postprocess_cb()
8787

8888
In this example, there are three returned objects from `makedemos`:
8989

90-
* `demopage`: this is the relative path to the generated demos (typically in `src/democards`), you
90+
* `demopage`: this is the relative path to the generated demos (typically in `src`), you
9191
can pass it to `makedocs`'s `pages`.
9292
* `postprocess_cb`: this is the callback function that you'll need to call after `makedocs`.
9393
* `demo_assets`: if available, it is the path to css file which you could pass to `Documenter.HTML`

docs/quickstart/usage_example/basics/hide_your_card_from_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There are cases that you want to hide one card in the generated page layout and
1010
entrance via reflink. For example, you have multiple version of demos and you only want to set the
1111
latest one as the default and provide legacy versions as reflink in the latest page.
1212

13-
This can be done by setting `hidden: false` in the frontmatter, for example:
13+
This can be done by setting `hidden: true` in the frontmatter, for example:
1414

1515
```markdown
1616
---

docs/quickstart/usage_example/julia_demos/2.cover_on_the_fly.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,28 @@ cover
3030
# There are cases that you want to hide the codes related to asset generation, e.g., the
3131
# `save(...)` line. Fortunately, this is doable by combining the syntax of Documenter and Literate.
3232
# For example, the following code can be inserted to whereever you need to generate the assets.
33-
# The [`#src` flag](https://fredrikekre.github.io/Literate.jl/v2/fileformat/#Filtering-Lines) is used as a filter to tell Literate that this line is reserved only in the
34-
# original source codes.
33+
# The [`#src` flag](https://fredrikekre.github.io/Literate.jl/v2/fileformat/#Filtering-Lines) is
34+
# used as a filter to tell Literate that this line is reserved only in the original source codes.
3535
#
3636
# ```julia
37-
# save("assets/cover.png", img_noise) #src
37+
# save("assets/cover.png", img_noise) #src #md
3838
# ```
3939
#
4040
# Gif image is also supported via `ImageMagick`:
4141
#
4242
# ```julia
43-
# # --- save covers --- #src
44-
# using ImageMagick #src
45-
# imgs = map(10:5:50) do k #src
46-
# colorview(RGB, rank_approx.(svdfactors, k)...) #src
47-
# end #src
48-
# ImageMagick.save("assets/color_separations_svd.gif", cat(imgs...; dims=3); fps=2) #src
43+
# # --- save covers --- #src #md
44+
# using ImageMagick #src #md
45+
# imgs = map(10:5:50) do k #src #md
46+
# colorview(RGB, rank_approx.(svdfactors, k)...) #src #md
47+
# end #src #md
48+
# ImageMagick.save("assets/color_separations_svd.gif", cat(imgs...; dims=3); fps=2) #src #md
4949
# ```
5050
#
5151
# ### Hide the output result
5252
#
5353
# It does not look good to show the `0` result in the above code block as it does not provide
54-
# anything that the reader cares.There are two ways to fix this.
54+
# anything that the reader cares. There are two ways to fix this.
5555
#
5656
# The first way is to insert a [`#hide`
5757
# flag](https://juliadocs.github.io/Documenter.jl/stable/man/syntax/#@example-block) to the line you
@@ -72,14 +72,14 @@ save("assets/lena_color_256.png", cover) #hide
7272
#
7373
# ```julia
7474
# cover = testimage("lena_color_256")
75-
# save("assets/lena_color_256.png", cover) #hide
75+
# save("assets/lena_color_256.png", cover) #hide #md
7676
# nothing #hide #md #md
7777
# ```
7878
#
7979
# generates
8080

8181
cover = testimage("lena_color_256")
82-
save("assets/lena_color_256.png", cover)
82+
save("assets/lena_color_256.png", cover) #hide
8383
nothing #hide #md
8484

8585
# No output at all. You could, of course, insert `cover #hide #md` or others you would like readers
@@ -88,14 +88,14 @@ nothing #hide #md
8888
#
8989
# ```julia
9090
# cover = testimage("lena_color_256")
91-
# save("assets/lena_color_256.png", cover) #hide
91+
# save("assets/lena_color_256.png", cover) #hide #md #md
9292
# cover #hide #md #md
9393
# ```
9494
#
9595
# generates
9696

9797
cover = testimage("lena_color_256")
98-
save("assets/lena_color_256.png", cover) #hide
98+
save("assets/lena_color_256.png", cover) #hide #md
9999
cover #hide #md
100100

101101
# The `#md` flag is used to keep a clean `.jl` file provided by the download-julia badge:

src/generate.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Processing pipeline:
4949
The following is the simplest example for you to start with:
5050
5151
```julia
52-
# 1. preprocess and generate demo files to docs/src/democards
52+
# 1. preprocess and generate demo files to docs/src
5353
examples, postprocess_cb, demo_assets = makedemos("examples")
5454
5555
assets = []
@@ -430,7 +430,7 @@ function get_source_url(build_url, source, cardname, src)
430430
# - build_dir: "$build_root/$prefix/$page/$section/$subsection"
431431
# - build_url: "$build_dir/$cardfile"
432432
# example of build_url:
433-
# "https://github.com/johnnychen94/DemoCards.jl/blob/master/docs/src/democards/quickstart/usage_example/julia_demos/2.cover_on_the_fly.md"
433+
# "https://github.com/johnnychen94/DemoCards.jl/blob/master/docs/src/quickstart/usage_example/julia_demos/2.cover_on_the_fly.md"
434434
# we need to generate:
435435
# - src_root: "$projct_root/$docs_root/$src"
436436
# - src_dir: "$src_root/$prefix/$page/$section/$subsection"

0 commit comments

Comments
 (0)