Skip to content

Commit

Permalink
Merge branch 'jgm:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
dai authored Dec 26, 2024
2 parents 65f67fc + f7e12e9 commit 9614073
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 34 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ VIMDIR?=~/.vim

all: doc/syntax.html

# luarocks install --lua-version=5.4 djot

doc/syntax.html: doc/syntax.md
pandoc --lua-filter doc/code-examples.lua $< -t html -o $@ -s --css doc/syntax.css --self-contained --wrap=preserve --toc --section-divs -Vpagetitle="Djot syntax reference"
pandoc --lua-filter doc/code-examples.lua $< -t html -o $@ -s --css doc/syntax.css --embed-resources --wrap=preserve --toc --section-divs -Vpagetitle="Djot syntax reference"

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ There are currently six djot implementations:
- [godjot (Go)](https://github.com/sivukhin/godjot)
- [djoths (Haskell)](https://github.com/jgm/djoths)

[Here](https://github.com/dcampbell24/djot-implementations) are some benchmarks of these implementations.

djot.lua was the original reference implementation, but
current development is focused on djot.js, and it is possible
that djot.lua will not be kept up to date with the latest syntax
Expand Down
58 changes: 29 additions & 29 deletions doc/syntax.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}

ul.task-list[class]{list-style: none;}
ul.task-list li input[type="checkbox"] {
font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
Expand Down Expand Up @@ -233,9 +235,6 @@
font-size: 78%;
}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<nav id="TOC" role="doc-toc">
Expand Down Expand Up @@ -762,7 +761,7 @@ <h3>Footnote reference</h3>
<h3>Line break</h3>
<p>Line breaks in inline content are treated as “soft” breaks; they may be
rendered as spaces, or (in contexts where newlines are treated
semantically like spaces, such as HTML) as as newlines.</p>
semantically like spaces, such as HTML) as newlines.</p>
<p>To get a hard line break (of the sort represented by HTML’s <code>&lt;br&gt;</code>), use
backslash + newline:</p>
<div class="example">
Expand Down Expand Up @@ -815,7 +814,7 @@ <h3>Symbols</h3>
<pre><code>My reaction is :+1: :smiley:.</code></pre>
</div>
<div class="html">
<pre><code>&lt;p&gt;My reaction is 👍 😃.&lt;/p&gt;
<pre><code>&lt;p&gt;My reaction is :+1: :smiley:.&lt;/p&gt;
</code></pre>
</div>
</div>
Expand Down Expand Up @@ -1080,89 +1079,89 @@ <h3>List item</h3>
<p>The following basic types of list markers are available:</p>
<table>
<thead>
<tr class="header">
<tr>
<th>Marker</th>
<th>List type</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<tr>
<td><code>-</code></td>
<td>bullet</td>
</tr>
<tr class="even">
<tr>
<td><code>+</code></td>
<td>bullet</td>
</tr>
<tr class="odd">
<tr>
<td><code>*</code></td>
<td>bullet</td>
</tr>
<tr class="even">
<tr>
<td><code>1.</code></td>
<td>ordered, decimal-enumerated, followed by period</td>
</tr>
<tr class="odd">
<tr>
<td><code>1)</code></td>
<td>ordered, decimal-enumerated, followed by parenthesis</td>
</tr>
<tr class="even">
<tr>
<td><code>(1)</code></td>
<td>ordered, decimal-enumerated, enclosed in parentheses</td>
</tr>
<tr class="odd">
<tr>
<td><code>a.</code></td>
<td>ordered, lower-alpha-enumerated, followed by period</td>
</tr>
<tr class="even">
<tr>
<td><code>a)</code></td>
<td>ordered, lower-alpha-enumerated, followed by parenthesis</td>
</tr>
<tr class="odd">
<tr>
<td><code>(a)</code></td>
<td>ordered, lower-alpha-enumerated, enclosed in parentheses</td>
</tr>
<tr class="even">
<tr>
<td><code>A.</code></td>
<td>ordered, upper-alpha-enumerated, followed by period</td>
</tr>
<tr class="odd">
<tr>
<td><code>A)</code></td>
<td>ordered, upper-alpha-enumerated, followed by parenthesis</td>
</tr>
<tr class="even">
<tr>
<td><code>(A)</code></td>
<td>ordered, upper-alpha-enumerated, enclosed in parentheses</td>
</tr>
<tr class="odd">
<tr>
<td><code>i.</code></td>
<td>ordered, lower-roman-enumerated, followed by period</td>
</tr>
<tr class="even">
<tr>
<td><code>i)</code></td>
<td>ordered, lower-roman-enumerated, followed by parenthesis</td>
</tr>
<tr class="odd">
<tr>
<td><code>(i)</code></td>
<td>ordered, lower-roman-enumerated, enclosed in parentheses</td>
</tr>
<tr class="even">
<tr>
<td><code>I.</code></td>
<td>ordered, upper-roman-enumerated, followed by period</td>
</tr>
<tr class="odd">
<tr>
<td><code>I)</code></td>
<td>ordered, upper-roman-enumerated, followed by parenthesis</td>
</tr>
<tr class="even">
<tr>
<td><code>(I)</code></td>
<td>ordered, upper-roman-enumerated, enclosed in parentheses</td>
</tr>
<tr class="odd">
<tr>
<td><code>:</code></td>
<td>definition</td>
</tr>
<tr class="even">
<tr>
<td><code>- [ ]</code></td>
<td>task</td>
</tr>
Expand Down Expand Up @@ -1716,8 +1715,9 @@ <h3>Footnote</h3>
<h3>Block attributes</h3>
<p>To attach attributes to a block-level element, put the attributes on the
line immediately before the block. Block attributes have the same syntax
as inline attributes, but they must fit on one line. Repeated attribute
specifiers can be used, and the attributes will accumulate.</p>
as inline attributes, but if they don’t fit on one line, subsequent lines
must be indented. Repeated attribute specifiers can be used, and
the attributes will accumulate.</p>
<div class="example">
<div class="djot">
<pre><code>{#water}
Expand Down
8 changes: 4 additions & 4 deletions editors/vim/syntax/djot.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ syn region comment matchgroup=delimiter start='%' end='%' contained
syn region string start='"' end='"' skip='\\"'
syn region attributes matchgroup=delimiter start="{[^\[\]_*'\"=\\+-]\@=" end="}" contains=string,comment

syn region emphasis matchgroup=delimiter start='_[^\s}]\@=\|{_' end='_}\|[^\s{]\@=_\|^\s*$' contains=@inline
syn region strong matchgroup=delimiter start='\*[^\s}]\@=\|{\*' end='[^\s{]\@=\*\|\*}\|^\s*$' contains=@inline
syn region emphasis matchgroup=delimiter start='_[^[:blank:]}]\@=\|{_' end='_}\|[^[:blank:]{]\@=_\|^\s*$' contains=@inline
syn region strong matchgroup=delimiter start='\*[^[:blank:]}]\@=\|{\*' end='[^[:blank:]{]\@=\*\|\*}\|^\s*$' contains=@inline

syn region superscript matchgroup=delimiter start='\^[^\s}]\@=\|{\^' end='\^}\|[^\s{]\@=\^\|^\s*$' contains=@inline
syn region subscript matchgroup=delimiter start='\~[^\s}]\@=\|{\~' end='\~}\|[^\s{]\@=\~\|^\s*$' contains=@inline
syn region superscript matchgroup=delimiter start='\^[^[:blank:]}]\@=\|{\^' end='\^}\|[^[:blank:]{]\@=\^\|^\s*$' contains=@inline
syn region subscript matchgroup=delimiter start='\~[^[:blank:]}]\@=\|{\~' end='\~}\|[^[:blank:]{]\@=\~\|^\s*$' contains=@inline

syn region highlight matchgroup=delimiter start='{=' end='=}\|^\s*$' contains=@inline
syn match rawattribute "`\@<={=[A-Za-z0-9]*}"
Expand Down

0 comments on commit 9614073

Please sign in to comment.