Comments (9)
I wrote out an example to see what the tests would look like in this syntax. I think that the text from block comments should also be allowed because it got kind of cluttered with #
s.
from documenter.jl.
I created https://github.com/fredrikekre/Literate.jl to solve this exact problem. Works quite well and generates markdown and a notebook. The source file is runnable julia so they can be included in the tests.
from documenter.jl.
Perhaps this would be nice to make more accessible than it is currently, but it can be done using {eval}
code blocks as follows:
In Package/test/example.jl
:
A = rand(3, 3)
b = [1, 2, 3]
A \ b
and in Package/docs/src/index.md
:
```
{eval}
Markdown.Code("julia", readall(joinpath("..", "..", "test", "example.jl")))
```
Any suggestions for syntax to annotate the file contents? I'd be inclined to just add them as comments in the test file itself since splitting content and discussion across multiple locations would probably result in things getting out of sync quickly.
from documenter.jl.
I agree that it's best if the annotations were in the code (then the code would read as a nice tutorial as well.
We may want this annotation to match up with JunoLab/atom-julia-client#63. Maybe @pfitzseb would like to chime in. They are looking to make "executable code blocks" where you can divy up a file and have it just execute parts at a time. I think that this would match quite well to this, since in a tutorial you probably want a block of text, then a block of code, then repeat. So maybe just make a block that is only a string? ##"""" """"##, matching the syntax they use?
It seems like they want ## since it matches with Markdown. I'd say that after making documentation it would be best if the blocks would also work with making ### since it would be too many h2 headers.
from documenter.jl.
Yes, would be good to reuse syntax from elsewhere for this rather than reinventing more things.
from documenter.jl.
Not that I'm totally sure if that's what you're looking for, but I'd imagine something like
### Starting a new cell
# Let's foo the bar:
foobar = foo(bar)
# And indeed, it's foo'ed:
@test foobar == 42
### Next cell
...
to work nicely. It should be quite easy to transform this to
Starting a new cell
Let's foo the bar
foobar = foo(bar)
And indeed, it's foo'ed:
@test foobar == 42
Next cell
...
by just having a mapping from literal code to code blocks and then stripping the first #
from the comments.
from documenter.jl.
Thanks for the description @pfitzseb, that looks good to me.
from documenter.jl.
text from block comments should also be allowed
Fine with me.
from documenter.jl.
I am wondering whether there is some API Documenter could provide to make it a bit more natural to include dynamically generated pages. However, this feature exists as package now, so I think we can close this issue, and new issues can be opened if there are more specific requests.
from documenter.jl.
Related Issues (20)
- Orthogonalize the API for Docker vs LaTeX engine/platform
- Multiple references to the same footnote HOT 2
- LaTeX (stuff in $ ... $) is rendered in very large font HOT 5
- Search should not be case-sensitive HOT 1
- Something close to latex's `amsthm` environments ? HOT 1
- Add Banner for "This is for unreleased docs" HOT 2
- More fine-grained checkdocs keyword in makedocs HOT 2
- docs build failing on obscure `@assert` HOT 5
- The `version` argument for `makedocs` HOT 6
- How to cite the Documenter.jl package HOT 5
- Functions `get_url` and `pretty_url` return invalid backslashes on Windows
- simple feature idea: hide extended help by default HOT 2
- Prevent leaking trackable pageview stats to CDNs by default HOT 2
- link fragments should follow the GitHub heading algorithm HOT 6
- Remove CI-dependent `prettyurls` and recommend LiveServer.jl? HOT 8
- Deployment criteria for GITHUB_REPOSITORY env variable should be case insensitive HOT 1
- Emoji support HOT 3
- Hidden leading lines in @repl blocks add an extra line HOT 2
- Document how to manually clean up `gh-pages` HOT 8
- Out-of-repo deployment doesn't work for me HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documenter.jl.