Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the guide and focus on iterative package / docs development #1451

Closed
wants to merge 1 commit into from

Conversation

haampie
Copy link

@haampie haampie commented Oct 22, 2020

Solves #1413

@haampie haampie force-pushed the master branch 5 times, most recently from 75920cb to 4be48f3 Compare October 22, 2020 19:47
@haampie
Copy link
Author

haampie commented Oct 22, 2020

This new guide is a bit sneaky, in the sense that Revise.jl only seems to pick up new docstrings when the newly created Example package contains at least one function with a docstring from the start. So instead of starting with 0 docstrings like in the original guide, a first step is to add a docstring to the greet() function.

Copy link
Member

@mortenpi mortenpi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @haampie! This is great -- this page really needs some updating. And sorry for a delayed review.

I wonder if it would be good to have a really quickstart section for a user who needs to edit the documentation of an existing package (so omit the setup, just focus on calling Documenter)?


## Preliminaries

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a paragraph here about why you'd want to use this more interactive workflow. E.g. something along these lines (but edits definitely welcome):

Suggested change
While the standard Documenter setup allows package documentation to be built on the command line by simply executing the `make.jl` script with e.g. `julia --project=docs/ docs/make.jl`, this is can be slow due to all the re-compilation happening in every new Julia session.

pkg> add Documenter
(@v1.5) pkg> add Revise

julia> using Revise
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to warn here to make sure Revise gets added to the global environment (even though it's implied by (@1.5)>), and not to either as a package dependency or in docs/Project.toml.

Comment on lines +93 to +94
(docs) pkg> dev Example
[ Info: Resolving package identifier `Example` as a directory at `~/Documents/projects/Example`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This recommendation could be problematic, because it could clone a new package into ~/.julia/dev/Example.jl, if you don't happen to be in the right directory? Perhaps better to use a relative path (pkg> dev . if in package root, or pkg> dev .. if under docs/) ?

Firstly, we need a Julia module to document. This could be a package generated via
`PkgDev.generate` or a single `.jl` script accessible via Julia's `LOAD_PATH`. For this
guide we'll be using a package called `Example.jl` that has the following directory layout:
Go back to the Pkg REPL and generate a new package:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be really good to advertise PkgTemplates here.

Now add an `index.md` file to the `src/` directory.
Since Documenter is a development tool and not a true dependency of your package, create
a fresh environment in the `docs/` folder, and add Documenter and the Example package
itself as dependencies:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also recommend adding a [compat] for Documenter into docs/Project.toml?

func(x)
```
````

### Filtering included docstrings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think heading should be "promoted" now, since ## Adding Some Docstrings was removed:

Suggested change
### Filtering included docstrings
## Filtering included docstrings

@knuesel
Copy link
Contributor

knuesel commented Jan 24, 2021

It would be nice to get this merged... It would also fix #1500. @haampie are you still interested in working on this PR? Or would you prefer for someone else to take it over?

@knuesel knuesel mentioned this pull request Jan 24, 2021
@mortenpi
Copy link
Member

mortenpi commented Nov 1, 2023

I'll close this since it's stale, but hopefully we can re-use bits from here as part of #2321.

@mortenpi mortenpi closed this Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants