Skip to content

Commit 268a73f

Browse files
committed
Improve the README
and reflect the fact that soupault has no option to only extract metadata anymore
1 parent a39ed04 commit 268a73f

File tree

1 file changed

+44
-20
lines changed

1 file changed

+44
-20
lines changed

README.md

+44-20
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,45 @@ soupault
44
![Build](https://github.com/PataphysicalSociety/soupault/actions/workflows/main.yml/badge.svg)
55
![GitHub all releases](https://img.shields.io/github/downloads/PataphysicalSociety/soupault/total)
66

7-
Soupault is an HTML manipulation tool. It can be:
8-
9-
* a static site generator,
10-
* an HTML processor,
11-
* a metadata extractor,
12-
13-
or all of the above.
7+
Soupault is an HTML manipulation tool. It can be a static site generator
8+
or an HTML (post-)processor for existing websites and allows you to define
149

1510
Soupault works with the HTML element tree of the page, so it can do many things that traditionally could be done with client-side JS:
16-
inject new HTML into existing complete pages, create a table of contents that preserves the `id` elements of HTML headings and more.
11+
inject new HTML into existing complete pages, create a table of contents that respects and uses `id`'s of HTML headings and more.
12+
13+
It also doesn't use front matter but extracts metadata from HTML instead: you tell it what to extract using CSS3 selectors,
14+
so even hand-written static pages can be indexed rather than treated as opaque assets.
1715

18-
It also doesn't use front matter and extracts metadata from HTML instead, using a CSS3 selector to metadata field mapping,
19-
so even hand-written static pages can be indexed rather than treated as assets. For example:
16+
For example, here's what a content model for a blog may look like:
2017

2118
```toml
19+
# Post title
2220
[index.fields.title]
23-
# Try to find <h1 id="post-title"> if it exists,
21+
# Try to find <h1 id="post-title">,
2422
# else use the first <h1>
2523
selector = ["h1#post-title", "h1"]
2624

25+
# Fail the build if post title cannot be found
26+
required = true
27+
28+
# Post excerpt
2729
[index.fields.excerpt]
30+
# Use <p id="post-excerpt"> if a page has it,
31+
# else use the first paragraph.
32+
# This allows using a paragraph other than the first one
33+
# as the post excerpt.
2834
selector = ["p#post-excerpt", "p"]
2935

36+
# Post date
3037
[index.fields.date]
3138
selector = ["time#post-date", "time"]
39+
40+
# Extract the datetime="" attribute from the <time> element,
41+
# if it's set.
3242
extract_attribute = "datetime"
43+
44+
# If there's no datetime attribute in <time>,
45+
# then use that element's content
3346
fallback_to_content = true
3447
```
3548

@@ -50,22 +63,33 @@ Extracted metadata can then be rendered and injected into pages:
5063
Soupault is...
5164

5265
* Durable and easy to upgrade or roll back: it's available as a statically-linked binary with no dependencies.
53-
* Extensible: you can bring your own [page preprocessors](https://soupault.app/reference-manual/#page-preprocessors) (e.g. Markdown to HTML convertors), pipe HTML elements through [external programs](https://soupault.app/reference-manual/#preprocess-element-widget), and load [Lua plugins](https://soupault.app/plugins/).
54-
* Flexible: most options are configurable, most built-in features can be reimplemented as Lua plugins, and there are [page processing hooks](https://soupault.app/reference-manual/#page-processing-hooks).
55-
56-
Soupault is named after the French dadaist and surrealist writer [Philippe Soupault](https://en.wikipedia.org/wiki/Philippe_Soupault)
57-
because it's based on the [lambdasoup](http://aantron.github.io/lambdasoup/) library.
66+
* Extensible: you can bring your own [page preprocessors](https://soupault.app/reference-manual/#page-preprocessors)
67+
(e.g., Markdown to HTML convertors), define [asset processors](https://soupault.app/reference-manual/#asset-processing)
68+
(e.g., a Sass/Less compiler, an image optimizer),
69+
pipe HTML elements through [external programs](https://soupault.app/reference-manual/#preprocess-element-widget),
70+
and load [Lua plugins](https://soupault.app/plugins/).
71+
* Flexible: most options are configurable, most built-in features can be reimplemented as Lua plugins,
72+
and there are [page processing hooks](https://soupault.app/reference-manual/#page-processing-hooks).
73+
74+
Soupault is named after [Philippe Soupault](https://en.wikipedia.org/wiki/Philippe_Soupault),
75+
a French dadaist and surrealist writer and poet,
76+
because it uses [lambdasoup](http://aantron.github.io/lambdasoup/) library to work with tag soups.
5877

5978
Visit [soupault.app](https://www.soupault.app) for details.
6079

6180
For support and discussion, write a message to the [mailing list](https://lists.sr.ht/~dmbaturin/soupault).
6281

6382
# Installation
6483

65-
Pre-built binaries are available for Linux, Windows, and macOS. You can download them from https://files.baturin.org/software/soupault
66-
and from Github releases (https://github.com/PataphysicalSociety/soupault/releases).
84+
Prebuilt binaries are available for Linux (x86-64 and Aarch64), Windows, and macOS (x86-64).
85+
You can download them from https://files.baturin.org/software/soupault
86+
and from GitHub releases (https://github.com/PataphysicalSociety/soupault/releases).
87+
88+
You can verify release archive integrity using this minisign key:
6789

68-
You can verify release archive integrity using this signify/minisign key: `RWRfW+gkhk/+iA7dOUtTio6G6KeJCiAEp4Zfozw7eqv2shN90+5z20Cy`.
90+
```
91+
minisign -VP RWRfW+gkhk/+iA7dOUtTio6G6KeJCiAEp4Zfozw7eqv2shN90+5z20Cy -m <file>
92+
```
6993

7094
You can also install stable release versions from [OPAM](https://opam.ocaml.org):
7195

@@ -83,7 +107,7 @@ To build static binaries, you need to install OCaml with musl runtime,
83107
then use the `static` Dune profile:
84108

85109
```
86-
# For OCaml 4.12.2, adjust for your desired version
110+
# For OCaml 4.14.2, adjust for your desired version
87111
opam switch create 4.14.2-musl ocaml-variants.4.14.2+options ocaml-option-musl ocaml-option-static
88112
opam switch 4.14.2-musl
89113

0 commit comments

Comments
 (0)