Skip to content

Commit

Permalink
docs: Djot manual overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
Omikhleia authored and Didier Willis committed Feb 25, 2024
1 parent df3977c commit 5bafb01
Show file tree
Hide file tree
Showing 8 changed files with 1,429 additions and 257 deletions.
12 changes: 12 additions & 0 deletions examples/data-pie.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Players,Games,Points,Ties,Aces
Albert,10,3,1
Bertrand,20,6,5
Charly,15,11
Diane,25,,2
Elisabeth,29
Fabrice,6,,4
Gerard,12
Herbert,30,7
Ian,5,,3,40
John,25,,,30
Theo,22,5,,25
180 changes: 180 additions & 0 deletions examples/djot-concept-simplified.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions examples/extra-styles.dj
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
```=sile
% Quick and dirty definition of new custom styles
% using some "resilient" styling feature.
%
\define[command=customframe]{\center{\roughbox[bordercolor=#59b24c,
fillcolor=220,padding=15pt, enlarge=true]{\parbox[width=90%lw, minimize=true]{\process}}}}
\define[command=customblockframe]{\center{\framebox[bordercolor=#7393b3,
shadow=true,
fillcolor=250,
padding=4pt,
shadowcolor=220]{\parbox[width=90%lw]{\process}}}}
```

```=sile-lua
-- Tapping into the internal scratch variable of the resilient.styles
-- package is not a good practice.
SILE.scratch.styles.alignments["fancy-framed"] = "customframe"
local class = SILE.documentState.documentClass
class:registerStyle("FramedPara", {}, {
paragraph = {
before = { skip = "medskip" },
after = { skip = "medskip" },
align = "fancy-framed"
}
})

SILE.scratch.styles.alignments["shadow-framed"] = "customblockframe"
local class = SILE.documentState.documentClass
class:registerStyle("CodeBlock", {}, {
paragraph = {
before = { skip = "smallskip" },
after = { skip = "smallskip" },
align = "shadow-framed"
}
})

local class = SILE.documentState.documentClass
class:registerCommand("Ean13", function (_, content)
local code = content[1]
-- Markdown parser may interpret a dash between digits as smart typography for en-dash.
-- Let's remove those.
code = code:gsub("–","")
SILE.call("ean13", { code = code })
end)

class:registerCommand("Initial", function (_, content)
local letter = content[1]
SILE.call("dropcap", { lines = 3, family = "Zallman Caps", join = true }, { letter })
end)
```
2 changes: 1 addition & 1 deletion examples/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The following package collections are not strictly required, but they are recomm
When installed, they provide additional features:

- The [**couyards.sile**](https://github.com/Omikhleia/couyards.sile) collection provides additional support for fancy thematic breaks.
- The [**piecharts**](https://github.com/Omikhleia/piecharts.sile) collection provides support for rendering pie charts from CSV data.
- The [**piecharts.sile**](https://github.com/Omikhleia/piecharts.sile) collection provides support for rendering pie charts from CSV data.

To install them, use the following commands:

Expand Down
Loading

0 comments on commit 5bafb01

Please sign in to comment.