×
Dustin Lennon

Dustin Lennon

Applied Scientist

2648A NW 57th St
Seattle, WA 98107
(206) 291-8893

Published Pages Cheatsheet

publishing framework feature overview

First Section

First Section

This is a cheat sheet for the features available in the Publishing Pages publication system.

Obligatory Lorem Ipsum

In lacinia nulla elit, in blandit quam mollis id. In sed nisl et leo pulvinar suscipit sit amet quis urna. Ut in turpis nisi. Nullam tristique ipsum nec malesuada consectetur. Fusce laoreet iaculis nibh, eu pharetra nibh tempus a. Nam euismod massa lacus, at lacinia urna pulvinar ut. Aliquam auctor massa quis sollicitudin imperdiet. Phasellus nisi magna, fringilla sed elit at, aliquet dapibus eros. Sed vel libero leo. Aenean vehicula diam quis accumsan tempor. Maecenas non nisl neque. Sed ut leo sem. Pellentesque ut lectus nunc.

Second Section

Second Section

An Image
![Figure 1:  An image of Lorem Ipsum](image.png){ width=70% }
Result
Lorem Ipsum
Lorem Ipsum
Python Source
```python
import json
s = 'hello, world'
print(s)

with open('foo') as f:
  json.loads(f)
```
Result
External HTML

External HTML

In the markdown file, add a div:

and in the file system, add a file:

external.html
Result
  1. apple
  2. banana
  3. cherry
Javascript

Javascript

AJAX Callback

AJAX Callback

Enable the AJAX endpoint via YAML frontmatter:

ExampleClass is a python class that extends AjaxResource. It will be instantiated with a local context containing the pagename and a directory containing copies of any file dependencies from the ./context directory.

ExampleClass will define a set of methods with the 'cmd_' prefix to be exposed as AJAX endpoints. The corresponding HTTP POST requests should be of type application/json, providing a dictionary with a key indicating the command, and additional keys for the parameters of the specific cmd_ method to be invoked.

Alternatively, ExampleClass may override AjaxResource's process method for additional flexibility.

See the AppContext.setup_mappings method in the staticpages module for specifics.

Python
Javascript

Here is a sample javascript AJAX call utilizing the localtime endpoint defined in AjaxResource and the hello endpoint with argument 'name' in the ExampleClass object.

Result
Preamble

Preamble

latex numbered equations
Custom latex declarations

\[ \DeclareMathOperator*{\argmax}{arg\,max} \notag \newcommand{\dotsim}{ \overset{.}{\sim} } \]

Use \ref{amx} to reference labeled equations.

Result

\[ \begin{gather} \argmax_n \left\{ n : \Pr \left[ T_n > 1 \right] \leq \varepsilon \right\} \label{amx} \\ \bar{X} \dotsim N(\mu,\sigma^2) \end{gather} \]

Equation \(\ref{amx}\) is the first one.