Skip to content

Commit

Permalink
adding footnotes and other goodies with JuDoc update and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart committed Sep 23, 2019
1 parent f58f45a commit f0d5a61
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JuDocTemplates"
uuid = "6793090a-55ae-11e9-0511-73b91164f4ea"
authors = ["Thibaut Lienart <[email protected]>"]
version = "0.2.5"
version = "0.2.6"

This comment has been minimized.

Copy link
@tlienart

tlienart Sep 23, 2019

Author Owner

@JuliaRegistrator register()


[compat]
julia = "^1.0.0"
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,18 @@ Most of these templates are adapted from existing, popular templates with minor
## Misc

* Current version of KaTeX: 0.11
* Current version of highlight: v9.15.10 (with `css`, `http`, `python`, `yaml`, `bash`, `ini,TOML`, `markdown`, `r`, `julia`, `julia-repl` and the minified `github` theme).
* Current version of highlight: v9.15.10 (with `css`, `python`, `yaml`, `bash`, `ini,TOML`, `markdown`, `html,xml`, `r`, `julia`, `julia-repl` and the minified `github` theme).

## Notes:

- if update `highlight.pack.js`, look for `julia>`, replace (so that pkg and shell are recognised)

```
return{c:[{cN:"meta",b:/^julia>/,r:10,starts:{e:/^(?![ ]{6})/,sL:"julia"},aliases:["jldoctest"]}]}
```

by

```
return{c:[{cN:"meta",b:/^julia>/,r:10,starts:{e:/^(?![ ]{6})/,sL:"julia"}},{cN:"metas",b:/^shell>/,r:10,starts:{e:/^(?![ ]{6})/,sL:"bash"}},{cN:"metap",b:/^\(.*\)\spkg>/,r:10,starts:{e:/^(?![ ]{6})/,sL:"julia"}}]}
```
2 changes: 1 addition & 1 deletion src/templates/basic/src/_html_parts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ul>
<li><a href="/">Home</a></li>
<li><a href="/pub/menu1.html">Code blocks</a></li>
<li><a href="/pub/menu2.html">Menu 2</a></li>
<li><a href="/pub/menu2.html">More goodies</a></li>
<li><a href="/pub/menu3.html">Menu 3</a></li>
</ul>
<img src="/assets/infra/hamburger.svg" id="menu-icon">
Expand Down
2 changes: 1 addition & 1 deletion src/templates/common/libs/highlight/highlight.pack.js

Large diffs are not rendered by default.

54 changes: 34 additions & 20 deletions src/templates/common/src/_css/judoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ html {
color: #1c1c1c;
}

/* ==================================================================
BASIC STYLING FOR TOC
================================================================== */
.jd-toc ol { counter-reset: item; }
.jd-toc li { display: block; }
.jd-toc li:before { content:counters(item, ".")" "; counter-increment: item}

/* ==================================================================
BASIC GRID FOR PROFILE PIC
================================================================== */
Expand All @@ -34,6 +27,12 @@ html {
padding-left: 0;
border-radius: 10px; }

.jd-content .footnote {
position: relative;
top: -0.5em;
font-size: 70%;
}

/* ==================================================================
FOOT / COPYRIGHT
================================================================== */
Expand Down Expand Up @@ -118,13 +117,10 @@ html {
margin-left: auto;
margin-right: auto;
border-collapse: collapse;
text-align: center;
}

text-align: center;}
.jd-content th, td{
padding: 10px;
border: 1px solid black;
}
border: 1px solid black;}

.jd-content blockquote {
background: #eeeeee;
Expand Down Expand Up @@ -152,12 +148,35 @@ html {
text-decoration: underline; }

/* ==================================================================
HYPERREFS
HYPERREFS AND FOOTNOTES
================================================================== */

.jd-content .eqref a { color: green; }
.jd-content .bibref a { color: green; }

.jd-content sup {
font-size: 70%;
vertical-align: super;
line-height: 0; }

.jd-content table.fndef {
margin: 0;
margin-bottom: 10px;}
.jd-content .fndef tr, td {
padding: 0;
border: 0;
text-align: left;}
.jd-content .fndef tr {
border-left: 2px solid lightgray;
}
.jd-content .fndef td.fndef-backref {
vertical-align: top;
font-size: 70%;
padding-left: 5px;}
.jd-content .fndef td.fndef-content {
font-size: 80%;
padding-left: 10px;}

/* ==================================================================
IMAGES in CONTENT
================================================================== */
Expand Down Expand Up @@ -200,19 +219,14 @@ body { counter-reset: eqnum; }
border-radius: 2px;
font-size: 90%; }

/*
NOTE if update `highlight.pack.js`, look for `julia>`, replace by (so that pkg and shell are recognised)
return{c:[{cN:"metaj",b:/^julia>/,r:10,starts:{e:/^(?![ ]{6})/,sL:"julia"},aliases:["jldoctest"]},{cN:"metas",b:/^shell>/,r:10,starts:{e:/^(?![ ]{6})/,sL:"bash"},aliases:["jldoctest"]},{cN:"metap",b:/^\(.*\)\spkg>/,r:10,starts:{e:/^(?![ ]{6})/,sL:"julia"},aliases:["jldoctest"]}]}
*/

.hljs {
font-size: 90%;
line-height: 1.35em;
border-radius: 10px; }

.hljs-metaj, .hljs-metas, .hljs-metap { font-weight: bold; }
.hljs-meta, .hljs-metas, .hljs-metap { font-weight: bold; }

.hljs-metaj { color: rgb(25, 179, 51); }
.hljs-meta { color: rgb(25, 179, 51); }

.hljs-metas { color: red; }

Expand Down
9 changes: 7 additions & 2 deletions src/templates/common/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@ Note that you may have to do a bit of CSS-styling to get these elements to look

### Symbols and html entities

If you want a dollar sign you have to escape it like so: \$, you can also use html entities like so: &rarr; or &pi; or, if you're using Juno for instance, you can use `\pi[TAB]` to insert the symbol as is: π (it will be converted to a html entity).
If you want a dollar sign you have to escape it like so: \$, you can also use html entities like so: &rarr; or &pi; or, if you're using Juno for instance, you can use `\pi[TAB]` to insert the symbol as is: π (it will be converted to a html entity).[^1]

If you want to show a backslash, just use it like so: \ ; if you want to force a line break, use a ` \\ ` like \\ so (this is on a new line).
If you want to show a backslash, just use it like so: \ ; if you want to force a line break, use a ` \\ ` like \\ so (this is on a new line).[^blah]

If you want to show a backtick, escape it like so: \` and if you want to show a tick in inline code use double backticks like ``so ` ...``.

Footnotes are nice too:

[^1]: this is the text for the first footnote, you can style all this looking at `.fndef` elements; note that the whole footnote definition is _expected to be on the same line_.
[^blah]: and this is a longer footnote with some blah from veggie ipsum: turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water spinach avocado daikon napa cabbage asparagus winter purslane kale. Celery potato scallion desert raisin horseradish spinach carrot soko.

## Basic JuDoc extensions

### Divs
Expand Down
57 changes: 55 additions & 2 deletions src/templates/common/src/pages/menu2.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
@def title = "Menu 2"
@def title = "More goodies"
@def hascode = true

# Menu 2 landing page
# More goodies

## More markdown support

The Julia Markdown parser in Julia's stdlib is not exactly complete and JuDoc strives to bring useful extensions that are either defined in standard specs such as Common Mark or that just seem like useful extensions.

* indirect references for instance [like so]

[like so]: http://existentialcomics.com/

or also for images

![][some image]

some people find that useful as it allows referring multiply to the same link for instance.

[some image]: https://upload.wikimedia.org/wikipedia/commons/9/90/Krul.svg

* un-qualified code blocks and indented code blocks are allowed and are julia by default

a = 1
b = a+1

or

```
a = 1
b = a+1
```

you can specify the default language with `@def lang = "julia"`.
If you actually want a "plain" code block, qualify it as `plaintext` like

```plaintext
so this is plain-text stuff.
```

## A bit more highlighting

Extension of highlighting for `pkg` an `shell` mode in Julia:

```julia-repl
(v1.4) pkg> add JuDoc
shell> blah
julia> 1+1
(Sandbox) pkg> resolve
```

you can tune the colouring etc via the

* `hljs-meta` (for `julia>`)
* `hljs-metas` (for `shell>`)
* `hljs-metap` (for `...pkg>`)
2 changes: 1 addition & 1 deletion src/templates/hyde/src/_html_parts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h1><a href="/">Hyde</a></h1>
<nav class="sidebar-nav">
<a class="sidebar-nav-item {{ispage /index.html}}active{{end}}" href="/">Home</a>
<a class="sidebar-nav-item {{ispage /pub/menu1.html}}active{{end}}" href="/pub/menu1.html">Code blocks</a>
<a class="sidebar-nav-item {{ispage /pub/menu2.html}}active{{end}}" href="/pub/menu2.html">Menu 2</a>
<a class="sidebar-nav-item {{ispage /pub/menu2.html}}active{{end}}" href="/pub/menu2.html">More goodies</a>
<a class="sidebar-nav-item {{ispage /pub/menu3.html}}active{{end}}" href="/pub/menu3.html">Menu 3</a>
</nav>
<p>&copy; {{fill author}}.</p>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/hypertext/src/_html_parts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1><a href="/">Hypertext Theme</a></h1>
<nav>
<a href="/" class="current">Home</a>
| <a href="/pub/menu1.html">Code blocks</a>
| <a href="/pub/menu2.html">Menu 2</a>
| <a href="/pub/menu2.html">More goodies</a>
| <a href="/pub/menu3.html">Menu 3</a>
<hr/>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/jemdoc/src/_html_parts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="menu-item"><a href="index.html" class="current">home</a></div>
<div class="menu-category">topics</div>
<div class="menu-item"><a href="/pub/menu1.html">Code blocks</a></div>
<div class="menu-item"><a href="/pub/menu2.html">Menu 2</a></div>
<div class="menu-item"><a href="/pub/menu2.html">More goodies</a></div>
<div class="menu-item"><a href="/pub/menu3.html">Menu 3</a></div>
</td>
<td id="layout-content">
Expand Down
2 changes: 1 addition & 1 deletion src/templates/lanyon/src/_html_parts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<nav class="sidebar-nav">
<a class="sidebar-nav-item {{ispage /index.html}}active{{end}}" href="/">Home</a>
<a class="sidebar-nav-item {{ispage /pub/menu1.html}}active{{end}}" href="/pub/menu1.html">Code blocks</a>
<a class="sidebar-nav-item {{ispage /pub/menu2.html}}active{{end}}" href="/pub/menu2.html">Menu 2</a>
<a class="sidebar-nav-item {{ispage /pub/menu2.html}}active{{end}}" href="/pub/menu2.html">More goodies</a>
<a class="sidebar-nav-item {{ispage /pub/menu3.html}}active{{end}}" href="/pub/menu3.html">Menu 3</a>
</nav>
<div class="sidebar-item">
Expand Down
2 changes: 1 addition & 1 deletion src/templates/pure-sm/src/_html_parts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ul class="pure-menu-list">
<li class="pure-menu-item {{ispage /index.html}}pure-menu-selected{{end}}"><a href="/" class="pure-menu-link">Home</a></li>
<li class="pure-menu-item {{ispage /pub/menu1.html}}pure-menu-selected{{end}}"><a href="/pub/menu1.html" class="pure-menu-link">Code blocks</a></li>
<li class="pure-menu-item {{ispage /pub/menu2.html}}pure-menu-selected{{end}}"><a href="/pub/menu2.html" class="pure-menu-link">Menu 2</a></li>
<li class="pure-menu-item {{ispage /pub/menu2.html}}pure-menu-selected{{end}}"><a href="/pub/menu2.html" class="pure-menu-link">More goodies</a></li>
<li class="pure-menu-item {{ispage /pub/menu3.html}}pure-menu-selected{{end}}"><a href="/pub/menu3.html" class="pure-menu-link">Menu 3</a></li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/tufte/src/_html_parts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ul>
<li><a href="/">Home</a></li>
<li><a href="/pub/menu1.html">Code blocks</a></li>
<li><a href="/pub/menu2.html">Menu 2</a></li>
<li><a href="/pub/menu2.html">More goodies</a></li>
<li><a href="/pub/menu3.html">Menu 3</a></li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/vela/src/_html_parts/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3 style='font-size: 25px'>Vela Template</h3>
<li><a href="/pub/menu1.html">Code blocks</a></li>
<li><a href="" class="has-arrow">Topic</a>
<ul>
<li><a href="/pub/menu2.html">Menu 2</a></li>
<li><a href="/pub/menu2.html">More goodies</a></li>
</ul>
</li>
<li><a href="/pub/menu3.html">Menu 3</a></li>
Expand Down

1 comment on commit f0d5a61

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/3766

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.6 -m "<description of version>" f0d5a61f465e30c261dfef9a4381b95297c59489
git push origin v0.2.6

Please sign in to comment.