Skip to content

Include documentation scripts #3516

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

Merged
merged 38 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5b22822
Add support for external scripts.
smimram Nov 10, 2023
9c1af4a
Generate doctest rules.
smimram Nov 10, 2023
f190f0b
Build doctest.
smimram Nov 10, 2023
b03a979
One more.
smimram Nov 10, 2023
1c874ee
Remove useless file.
smimram Nov 10, 2023
1f49257
Install pandoc-include
toots Nov 10, 2023
6d68bcf
More splitting.
smimram Nov 10, 2023
d6443d5
More.
smimram Nov 10, 2023
43bb744
More.
smimram Nov 10, 2023
ca373d6
Start fixing.
smimram Nov 10, 2023
bcbd48e
Progressing.
smimram Nov 11, 2023
d8bc1f4
Spelling.
smimram Nov 11, 2023
0e474b0
More.
smimram Nov 11, 2023
413fc09
Allow arguments.
smimram Nov 11, 2023
da09ed0
More fixing.
smimram Nov 11, 2023
6e867b8
Add file.touch.
smimram Nov 11, 2023
0388f02
More.
smimram Nov 12, 2023
52d0295
Fix radiopi.
smimram Nov 12, 2023
4fecf29
Fix response.
smimram Nov 12, 2023
ed0c943
More fixing.
smimram Nov 12, 2023
39f51fa
More fixing.
smimram Nov 12, 2023
bf91578
Dummy output.
smimram Nov 13, 2023
708d366
Merge branch 'main' into doc-include
smimram Nov 13, 2023
3b38ee9
Don't check for failability for now.
smimram Nov 13, 2023
c33feae
Restore on_done parameter of playlist.
smimram Nov 13, 2023
668977d
Fix scheduling.
smimram Nov 13, 2023
46bb6d6
Document opacity range.
smimram Nov 13, 2023
ae30d72
Many more tests.
smimram Nov 13, 2023
2202ca1
Need pandoc-include.
smimram Nov 13, 2023
d6e507e
install pandoc-include here too.
smimram Nov 13, 2023
b75d919
Fix.
smimram Nov 13, 2023
ccfd0fe
Need frei0r.
smimram Nov 13, 2023
c2122b8
Update before installing.
smimram Nov 13, 2023
c87ab90
More precise error.
smimram Nov 13, 2023
03d6a4a
HLS.
smimram Nov 13, 2023
e410a42
Cleaner generation.
smimram Nov 13, 2023
0fe8b89
More fixing.
smimram Nov 13, 2023
c8497cd
Reformat icy-update.
smimram Nov 13, 2023
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
2 changes: 1 addition & 1 deletion .github/scripts/build-doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ eval "$(opam config env)"
OCAMLPATH="$(cat ../.ocamlpath)"
export OCAMLPATH

opam install -y odoc
opam install -y odoc pandoc-include
dune build @doc
dune build --profile release ./src/js/interactive_js.bc.js
1 change: 1 addition & 0 deletions .github/scripts/build-posix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export PKG_CONFIG_PATH=/usr/share/pkgconfig/pkgconfig

opam update
opam install -y re.1.11.0
opam install -y pandoc-include

echo "::endgroup::"

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ["@citest", "@mediatest"]
target: ["@citest", "@doctest", "@mediatest"]
env:
HOME: /home/opam
steps:
Expand All @@ -245,13 +245,18 @@ jobs:
cd /tmp/liquidsoap-full/liquidsoap
# TMP
sudo -u opam -E ./.github/scripts/add-local-opam-packages.sh
sudo -u opam -E opam install -y ssl.0.7.0
sudo -u opam -E opam install -y ssl.0.7.0 pandoc-include
sudo -u opam -E ./.github/scripts/build-posix.sh "${{ steps.cpu_cores.outputs.count }}"
cp /tmp/liquidsoap-full/liquidsoap/_build/default/src/bin/liquidsoap.exe /tmp/${{ github.run_number }}/core/liquidsoap
- name: Compute stats
run: |
cd /tmp/liquidsoap-full/liquidsoap
sudo -u opam -E ./.github/scripts/stats-posix.sh
- name: Install additional packages
if: matrix.target == '@doctest'
run: |
sudo apt-get -y update
sudo apt-get -y install frei0r-plugins
- name: Run tests
env:
CPU_CORES: ${{ steps.cpu_cores.outputs.count }}
Expand All @@ -270,7 +275,7 @@ jobs:
name: metrics
path: ${{ github.workspace }}/${{ github.run_number }}/metrics
- name: Upload metrics
if: needs.build_details.outputs.is_fork != 'true' && matrix.target != '@mediatest'
if: needs.build_details.outputs.is_fork != 'true' && matrix.target == '@citest'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ New:
- Add `compute` parameter to `file.replaygain` to control gain calculation (#3438).
- Add `compute` parameter to `enable_replaygain_metadata` to control replay gain calculation (#3438).
- Add `copy:` protocol (##3506)
- Add `file.touch`.

Changed:

Expand Down
17 changes: 17 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
MD = $(wildcard content/*.md)

all: dune
@dune build @doc

test: dune
@for i in $(MD); do \
echo -n "Compiling $$i... "; \
pandoc --filter=pandoc-include --metadata title="bla" --template=template.html $$i -o /tmp/`basename $$i .md`.html; \
echo "done"; \
done
@dune build @doctest

dune:
@dune build @gendune --auto-promote

.PHONY: dune
3 changes: 0 additions & 3 deletions doc/content/.gitignore

This file was deleted.

54 changes: 1 addition & 53 deletions doc/content/complete_case.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,8 @@ Once you've managed to describe what you want in such a modular way, you're half

Now here is how to write that in [Liquidsoap](index.html).

```liquidsoap
#!/usr/bin/liquidsoap

# Lines starting with # are comments, they are ignored.

# Put the log file in some directory where
# you have permission to write.
log.file.path := "/tmp/<script>.log"
# Print log messages to the console,
# can also be done by passing the -v option to liquidsoap.
log.stdout := true
# Use the telnet server for requests
settings.server.telnet := true

# A bunch of files and playlists,
# supposedly all located in the same base dir.

default = single("~/radio/default.ogg")

day = playlist("~/radio/day.pls")
night = playlist("~/radio/night.pls")
jingles = playlist("~/radio/jingles.pls")
clock = single("~/radio/clock.ogg")

# Play user requests if there are any,
# otherwise one of our playlists,
# and the default file if anything goes wrong.
radio = fallback([ request.queue(id="request"),
switch([({ 6h-22h }, day),
({ 22h-6h }, night)]),
default])
# Add the normal jingles
radio = random(weights=[1,5],[ jingles, radio ])
# And the clock jingle
radio = add([radio, switch([({0m0s},clock)])])

# Add the ability to relay live shows
full =
fallback(track_sensitive=false,
[input.http("http://localhost:8000/live.ogg"),
radio])

# Output the full stream in OGG and MP3
output.icecast(%mp3,
host="localhost",port=8000,password="hackme",
mount="radio",full)
output.icecast(%vorbis,
host="localhost",port=8000,password="hackme",
mount="radio.ogg",full)
```{.liquidsoap include="content/liq/complete-case.liq"}

# Output the stream without live in OGG
output.icecast(%vorbis,
host="localhost",port=8000,password="hackme",
mount="radio_nolive.ogg",radio)
```

To try this example you need to edit the file names. In order to witness the switch from one playlist to another you can change the time intervals. If it is 16:42, try the intervals `0h-16h45` and `16h45-24h` instead of `6h-22h` and `22h-6h`. To witness the clock jingle, you can ask for it to be played every minute by using the `0s` interval instead of `0m0s`.
Expand Down
Loading