Skip to content

Commit

Permalink
begin usage guide & fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
carloskiki committed Aug 1, 2024
1 parent 0028f7c commit df53dcc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
body: ${{ env.RELEASE_NOTES }}
files: |
styles.css
font/
font
generate_release_notes: true
fail_on_unmatched_files: true

permissions:
contents: write
36 changes: 36 additions & 0 deletions site/docs/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Usage

Rendering mathematical equations with `pulldown-latex` obviously begins with using
the crate in order to generate the `mathml` markup. However, one also needs to include
the stylesheet and fonts necessary to render the equations correctly and aesthetically.

## Including the Required Files

Files can be included in one of two ways, either by using a CDN or by downloading them
from the release page and using them locally.

### Using a CDN

In the index.html file of your project, include the following lines:

```html
<head>
<!-- Rest of your HTML head -->
<!-- ...................... -->

<!-- Include the Stylesheet -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/carloskiki/pulldown-latex@{version}/styles.min.css">
<!-- Include the Fonts -->
<link rel="preload" href="https://cdn.jsdelivr.net/gh/carloskiki/pulldown-latex@{version}/font/" as="font" crossorigin="anonymous">

<!-- Rest of your HTML head -->
<!-- ...................... -->
</head>
```

Make sure to replace `{version}` with the version of the crate you are using or with `latest` if you want to use the
latest version available.

### Using Local Files

Download the files from the release page and include them in your project. Then, include the following lines in the
1 change: 0 additions & 1 deletion styles.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@namespace m url('http://www.w3.org/1998/Math/MathML');


/* Latin Modern Roman has various sizes. We use the generic name
"Latin Modern Roman" for the local versions and "LMRoman12" for the Web font.
*/
Expand Down

0 comments on commit df53dcc

Please sign in to comment.