Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tl/i1007 demos #1023

Merged
merged 3 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
fail-fast: false
matrix:
version:
- '1.3'
- '1'
os:
- ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion demos/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title = "Franklin FAQ"
tags = ["index"]
auto_code_path = true
has_math = true
+++

# Franklin Demos
Expand Down Expand Up @@ -250,7 +251,7 @@ and that's it 🏁.

## (009) custom environment for TikzCD

> TikzCDs is currently too disfunctional so the demo is commented out for now.
> TikzCDs is currently too disfunctional so the demo is commented out for now. Like TikzPicture, it's possible to make it work with Tectonic but Tectonic doesn't work on M* macs.

<!--

Expand Down
10 changes: 7 additions & 3 deletions demos/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,24 @@ end
###########
### 019 ###
###########

function hfun_render_table()
val = rand(1:10, 5)
tag = rand('A':'Z', 5)
math = rand(["\$a + b\$", "\$\\frac{1}{2}\$", "\$\\sqrt{2\\pi}\$"], 5)
website = rand(["[Franklin home page](https://franklinjl.org)", "[Franklin Github](https://github.com/tlienart/Franklin.jl)"], 5)
df = DataFrame(; val, tag, math, website)
pretty_table(
s = pretty_table(
String, # export table as a String
df;
nosubheader = true, # Remove the type from the column names
tf = tf_html_default, # Use the default HTML rendered
alignment = :c, # Center alignment
formatters = ((x, i, j) -> string(x), (x, i, j) -> Franklin.fd2html(x, nop = true)), # Convert every inner cell to html
formatters = ( # Convert every inner cell to html
(x, _, _) -> Franklin.fd2html(string(x), internal = true, nop = true),
(x, _, _) -> strip(x),
),
allow_html_in_cells = true, # needed given the previous rendering
)
return replace(s, raw"\\\\" => raw"\\")
end