Skip to content

Commit

Permalink
Merge pull request #6 from JuliaDispatch/mitie-patch-1
Browse files Browse the repository at this point in the history
First rough draft
  • Loading branch information
ChrisRackauckas authored Aug 18, 2024
2 parents 165598e + b7981a9 commit 8cddcaa
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 504 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/Deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
# NOTE: Python is necessary for the pre-rendering (minification) step
- name: Install python
uses: actions/setup-python@v2
with:
python-version: '3.8'
# NOTE: Here you can install dependencies such as matplotlib if you use
# packages such as PyPlot.
# - run: pip install matplotlib
- name: Install Julia
uses: julia-actions/setup-julia@v1
with:
version: '1' # Latest stable Julia release.
# NOTE
# The steps below ensure that NodeJS and Franklin are loaded then it
# installs highlight.js which is needed for the prerendering step
# (code highlighting + katex prerendering).
# Then the environment is activated and instantiated to install all
# Julia packages which may be required to successfully build your site.
# The last line should be `optimize()` though you may want to give it
# specific arguments, see the documentation or ?optimize in the REPL.
- run: julia -e '
using Pkg; Pkg.activate("."); Pkg.instantiate();
using NodeJS; run(`$(npm_cmd()) install highlight.js`);
using Franklin;
optimize()'
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: __site
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.vscode/
Manifest.toml

__site/
.DS_Store
node_modules/
Expand Down
Binary file modified _assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions _assets/infra/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions _layout/header.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<header>
<div class="blog-name"><a href="/">Basic Template</a></div>
<div class="blog-name"><a href="/">Stay tuned!</a></div>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="/menu1/">Code blocks</a></li>
<li><a href="/menu2/">More goodies</a></li>
<li><a href="/menu3/">Tags</a></li>
<li><a href="/about/">About</a></li>
<li><a href="/contribute/">Contribute</a></li>
<!-- <li><a href=/transparency/">Transparency</a></li> -->
</ul>
<img src="/assets/hamburger.svg" id="menu-icon">
</nav>
</header>
</header>
32 changes: 32 additions & 0 deletions about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
+++
title = "About Julia_Dispatch.fm"
+++

# About Julia_Dispatch.fm

(Last updated: {{ fill fd_mtime }})

In the summer of 2024, Michael has been ready for a change of pace.
He's realized his social skills are better than his programming skills,
so he should use that to help Julia.
At JuliaCon in Eindhoven, he's approached Chris about growing the ecosystem
by community work and outreach, maybe starting with a podcast?
Little did he know that Chris had been thinking about starting a Julia podcast
for a while by then.
It was the missing spark for ignition.
The two got to work immediately and here we are.

## Your hosts

Julia has a rich and diverse community.
You, too, could help us tell its story and introduce us to others.
We'd love to hear from you: send us your episodes or co-host with us.
Get in touch at [`[email protected]`](mailto:[email protected]).

### Chris Rackauckas

**todo** include mugshot and short bio

### Michael Tiemann

**todo** include mugshot and short bio
8 changes: 4 additions & 4 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Add here global page variables to use throughout your website.
-->
+++
author = "Septimia Zenobia"
author = "The Julia Dispatch team"
mintoclevel = 2

# uncomment and adjust the following line if the expected base URL of your website is something like [www.thebase.com/yourproject/]
Expand All @@ -17,9 +17,9 @@ ignore = ["node_modules/"]

# RSS (the website_{title, descr, url} must be defined to get RSS)
generate_rss = true
website_title = "Franklin Template"
website_descr = "Example website using Franklin"
website_url = "https://tlienart.github.io/FranklinTemplates.jl/"
website_title = "Julia_Dispatch.fm"
website_descr = "A podcast about Julia projects and their contributors"
website_url = "https://juliadispatch.fm/"
+++

<!--
Expand Down
31 changes: 31 additions & 0 deletions contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
+++
title = "Contribute to Julia_Dispatch.fm"
+++

# Contribute to Julia_Dispatch.fm

(Last updated: {{ fill fd_mtime }})

We'd love to have your input. You can

- **write us your suggestions**.
How should we have on (again) and why? What would you like to know?
What do you like or dislike about the podcast (and why)?
What other suggestions do you have?
- **spread the word**.
If you've enjoyed listening to us, share the news.
Recommend us to your friends and colleagues.
Rate us and follow us on Apple Music and Spotify.
Subscribe to our YouTube channel, leave a thumbs-up and a comment.
- **help us with the organization**.
We need to maintain a website, prepare and post-process episodes and
million other small things.
We organize right here on Github.
Feel free to browse through all the issues and submit your pull requests.
- **be part of the show**.
We're envisioning this as a podcast _for_ the community _by_ the community.
If you have an idea for an episode (with or without guest), open a pull request.
We'll try and help you with all the steps necessary.
Once the recording is ready, you're own episode could end up on the podcast as well.

<!-- what else? -->
191 changes: 14 additions & 177 deletions index.md
Original file line number Diff line number Diff line change
@@ -1,187 +1,24 @@
@def title = "Franklin Example"
@def tags = ["syntax", "code"]
@def title = "Julia_Dispatch.fm"

# How to use Franklin
# Julia_Dispatch.fm - A Julia Programming Podcast

\tableofcontents <!-- you can use \toc as well -->
<!-- \tableofcontents --> <!-- you can use \toc as well -->

This section is meant as a refresher if you're new to Franklin.
Have a look at both how the website renders and the corresponding markdown (`index.md`).
Modify at will to get a feeling for how things work!
`Julia_Dispatch.fm` is a podcast about all that matters about Julia.
We'll meet the wonderful people who contribute to the community and the language ecosystem.
Hear their stories, learn what brought them to Julia, what excites them and how you could potentially follow in their footsteps.

Ps: if you want to modify the header or footer or the general look of the website, adjust the files in
* `src/_css/` and
* `src/_html_parts/`.
## Episodes

## The base with Markdown
### Coming Up

The [standard markdown syntax](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) can be used such as titles using `#`, lists:
#### Tim Holy

* element with **bold**
* element with _emph_
[show notes]

or code-blocks `inline` or with highlighting (note the `@def hascode = true` in the source to allow [highlight.js](https://highlightjs.org/) to do its job):
## Footer

```julia
abstract type Point end
struct PointR2{T<:Real} <: Point
x::T
y::T
end
struct PointR3{T<:Real} <: Point
x::T
y::T
z::T
end
function len(p::T) where T<:Point
sqrt(sum(getfield(p, η)^2 for η fieldnames(T)))
end
```
Links to all the available sources:

You can also quote stuff

> You must have chaos within you to ...
or have tables:

| English | Mandarin |
| --------------- | ---------- |
| winnie the pooh | 维尼熊 |

Note that you may have to do a bit of CSS-styling to get these elements to look the way you want them (the same holds for the whole page in fact).

### 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).[^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).[^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 Franklin extensions

### Divs

It is sometimes useful to have a short way to make a part of the page belong to a div so that it can be styled separately.
You can do this easily with Franklin by using `@@divname ... @@`.
For instance, you could want a blue background behind some text.

@@colbox-blue
Here we go! (this is styled in the css sheet with name "colbox-blue").
@@

Since it's just a `<div>` block, you can put this construction wherever you like and locally style your text.

### LaTeX and Maths

Essentially three things are imitated from LaTeX

1. you can introduce definitions using `\newcommand`
1. you can use hyper-references with `\eqref`, `\cite`, ...
1. you can show nice maths (via KaTeX)

The definitions can be introduced in the page or in the `config.md` (in which case they're available everywhere as opposed to just in that page).
For instance, the commands `\scal` and `\R` are defined in the config file (see `src/config.md`) and can directly be used whereas the command `\E` is defined below (and therefore only available on this page):

\newcommand{\E}[1]{\mathbb E\left[#1\right]}

Now we can write something like

$$ \varphi(\E{X}) \le \E{\varphi(X)}. \label{equation blah} $$

since we've given it the label `\label{equation blah}`, we can refer it like so: \eqref{equation blah} which can be convenient for pages that are math-heavy.

In a similar vein you can cite references that would be at the bottom of the page: \citep{noether15, bezanson17}.

**Note**: the LaTeX commands you define can also incorporate standard markdown (though not in a math environment) so for instance let's define a silly `\bolditalic` command.

\newcommand{\bolditalic}[1]{_**!#1**_} <!--_ ignore this comment, it helps atom to not get confused by the trailing underscore when highlighting the code but is not necessary.-->

and use it \bolditalic{here for example}.

Here's another quick one, a command to change the color:

\newcommand{\col}[2]{~~~<span style="color:~~~#1~~~">~~~!#2~~~</span>~~~}

This is \col{blue}{in blue} or \col{#bf37bc}{in #bf37bc}.

### A quick note on whitespaces

For most commands you will use `#k` to refer to the $k$-th argument as in LaTeX.
In order to reduce headaches, this forcibly introduces a whitespace on the left of whatever is inserted which, usually, changes nothing visible (e.g. in a math settings).
However there _may be_ situations where you do not want this to happen and you know that the insertion will not clash with anything else.
In that case, you should simply use `!#k` which will not introduce that whitespace.
It's probably easier to see this in action:

\newcommand{\pathwith}[1]{`/usr/local/bin/#1`}
\newcommand{\pathwithout}[1]{`/usr/local/bin/!#1`}

* with: \pathwith{script.jl}, there's a whitespace you don't want 🚫
* without: \pathwithout{script.jl} here there isn't ✅

### Raw HTML

You can include raw HTML by just surrounding a block with `~~~`.
Not much more to add.
This may be useful for local custom layouts like having a photo next to a text in a specific way.

~~~
<div class="row">
<div class="container">
<img class="left" src="/assets/rndimg.jpg">
<p>
Marine iguanas are truly splendid creatures. They're found on the Gálapagos islands, have skin that basically acts as a solar panel, can swim and may have the ability to adapt their body size depending on whether there's food or not.
</p>
<p>
Evolution is cool.
</p>
<div style="clear: both"></div>
</div>
</div>
~~~

**Note 1**: again, entire such blocks can be made into latex-like commands via `\newcommand{\mynewblock}[1]{...}`.

**Note 2**: whatever is in a raw HTML block is *not* further processed (so you can't have LaTeX in there for instance). A partial way around this is to use `@@...` blocks which *will* be recursively parsed. The following code gives the same result as above with the small difference that there is LaTeX being processed in the inner div.

@@row
@@container
@@left ![](/assets/rndimg.jpg) @@
@@
Marine iguanas are **truly splendid** creatures. They're not found in equations like $\exp(-i\pi)+1$. But they're still quite cool.
~~~
<div style="clear: both"></div>
~~~
@@

## Pages and structure

Here are a few empty pages connecting to the menu links to show where files can go and the resulting paths. (It's probably best if you look at the source folder for this).

* [menu 1](/menu1/)
* [menu 2](/menu2/)
* [menu 3](/menu3/)

## References (not really)

* \biblabel{noether15}{Noether (1915)} **Noether**, Körper und Systeme rationaler Funktionen, 1915.
* \biblabel{bezanson17}{Bezanson et al. (2017)} **Bezanson**, **Edelman**, **Karpinski** and **Shah**, [Julia: a fresh approach to numerical computing](https://julialang.org/research/julia-fresh-approach-BEKS.pdf), SIAM review 2017.

## Header and Footer

As you can see here at the bottom of the page, there is a footer which you may want on all pages but for instance you may want the date of last modification to be displayed.
In a fashion heavily inspired by [Hugo](https://gohugo.io), you can write things like

```html
Last modified: {{ fill fd_mtime }}.
```

(cf. `src/_html_parts/page_foot.html`) which will then replace these braces with the content of a dictionary of variables at the key `fd_mtime`.
This dictionary of variables is accessed locally by pages through `@def varname = value` and globally through the `config.md` page via the same syntax.

There's a few other such functions of the form `{{fname p₁ p₂}}` as well as support for conditional blocks. If you wander through the `src/_html_parts/` folder and its content, you should be able to see those in action.
-
- Github [![Github logo](assets/infra/github.svg)](https://github.com/JuliaDispatch/)
Loading

0 comments on commit 8cddcaa

Please sign in to comment.