Comments (12)
Whatever solution is considered for figures and subfigures, captions should probably be generalized with a consistent syntax across blocks where they are appropriate:
- Tables (we do have the
^
caption syntax currently...) - Code blocks (-> captioned listings)
- Figures (-> captioned blocks of images or whatnots)
- Quotes (-> captioned quotes)
- Others?
See also #28
from djot.
What about
!!!label
![alt text](path/to/image.png)
![other alt text](path/to/other.png)
:: Short caption on one line
Long caption which may have multiple lines/paragraphs.
!!!
And if you need a grid you simply use table structure (pipe or list).
from djot.
The point of using the exclamation point is that it is already used to differentiate inline images from links.
from djot.
Do you mean supporting a feature where you can write something like, "see figure 4", and that will render as a link to an image (as in ![figure 4](figure-4.png)
?
from djot.
No, this is about creating the figure itself: an environment that may contain one or more images, or perhaps other things, plus a caption and a label that can be the target of references.
from djot.
Would the current way to get something similar to this be to add the figure as an image, like this:
![figure 4](figure-4.png){#fig-4}
and then link to it with "[see figure 4](#fig-4)
"?
from djot.
In pandoc's markdown that will produce a figure (implicit_figures
extension), but we haven't implemented that here. I think I'd prefer to have something more explicit for generating figures.
from djot.
Ok, I understand. Thanks.
I wonder if there's a way to re-use the div syntax for this, like
::: figure
foo ...
:::
Similar to the list tables idea #27 .
from djot.
Actually, if I were "delimiter-shopping" for a punctuation character to use for figures, it would be hard to beat &
--- I mean, it looks just like a figure that a figure skater might make. Stealing @bpj 's example:
&&& label
![alt text](path/to/image.png)
![other alt text](path/to/other.png)
Short caption on one line
Long caption which may have multiple
lines/paragraphs.
&&&
from djot.
Yeah, I see that, though I don't think the !!!
looks good.
from djot.
If ---
is free, this looks good:
--- figure 4
![alt text](path/to/image.png)
![other alt text](path/to/other.png)
Short caption on one line
Long caption which may have multiple
lines/paragraphs.
---
I don't know how you could enhance that to support figures containing subfigures, as in "figure 4(a), 4(b), etc." Maybe using a definition list inside the figure block, e.g.:
--- figure 4
: figure 4(a)
![alt text](path/to/figure-4-a.png)
Short caption for fig 4(a), on one line
Long caption which may have multiple
lines/paragraphs.
: figure 4(b)
![alt text](path/to/figure-4-b.png)
Short caption for fig 4(b), on one line
Long caption which may have multiple
lines/paragraphs.
---
from djot.
FWIW: Given how flexible Djot’s syntax already is, it may not be necessary to introduce new syntax – e.g.:
[Figure](#fig:diagram){!float} visualizes how everything is connected.
{!float for="Figure" #fig:diagram}
:::
![](img/venn-diagram.svg){width="277.164" height="176.5"}
---
Visual explanation.
:::
[Table](#tbl:summary){!float} contains a summary.
{!float for="Table" #tbl:summary}
:::
| Output | Vector | Bitmap |
|--------|--------|--------|
| HTML | `.svg` | `.jpg` |
| LaTeX | `.pdf` | `.jpg` |
---
Brief summary.
:::
Notes:
!float
is a command (which I use in my Markdown dialect), it could also be the class.float
. Commands work much like classes but have a separate namespace and don’t produce output – unless there is a plugin/filter.
from djot.
Related Issues (20)
- Standalone attributes HOT 6
- Attribute references HOT 4
- Playground should provide examples
- Tables with a column of th elements HOT 1
- Typo in syntax.md
- Proposal: Punctuation Character for Code Block's language specifier HOT 6
- Playground: slow on Safari HOT 5
- Supporting “commands” in addition to “classes” in attributes? HOT 2
- Hard-wrapping: require subsequent lines to be indented/quoted? HOT 6
- Two asterisks for “strong”? HOT 3
- Inline footnotes?
- Support `<dfn>`, `<cite>` and `<i>`? HOT 2
- Parsing inconsistency: lazy paragraph lines in lists HOT 4
- The closing delimiter of a div block can interrupt a paragraph HOT 4
- Should block attributes mark a div block delimiter as opening? HOT 1
- section nesting for non-consecutive heading levels HOT 1
- [Proposal] more permissive definition of allowed symbol syntax HOT 43
- [Proposal] Remove leading whitespace HOT 2
- Allow any valid HTML4 identifier string to be a djot identifier string HOT 2
- Allow underscore in task list to denote unchecked item HOT 2
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 djot.