Skip to content

Commit 4b21f9e

Browse files
authored
Use git version of ocaml-pandoc for now. (#3532)
1 parent 5e22e9a commit 4b21f9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1023
-416
lines changed

.github/scripts/build-doc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ eval "$(opam config env)"
77
OCAMLPATH="$(cat ../.ocamlpath)"
88
export OCAMLPATH
99

10-
opam install -y odoc pandoc-include
10+
opam install -y odoc
1111
dune build @doc
1212
dune build --profile release ./src/js/interactive_js.bc.js

.github/workflows/ci.yml

+29-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
pre-commit:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- uses: actions/setup-python@v4
2121
with:
2222
python-version: "3.x"
@@ -73,17 +73,22 @@ jobs:
7373
git remote set-url origin https://github.com/savonet/liquidsoap.git
7474
git fetch origin ${{ github.sha }}
7575
git checkout ${{ github.sha }}
76+
- name: Install pandoc
77+
run: |
78+
cd /tmp
79+
git clone https://github.com/smimram/ocaml-pandoc.git
80+
opam pin -y add ocaml-pandoc
7681
- name: Build
7782
run: |
7883
echo "::group::Preparing build"
7984
cd /tmp/liquidsoap-full
8085
git remote set-url origin https://github.com/savonet/liquidsoap-full.git
81-
git fetch --recurse-submodules=no && git checkout origin/master -- Makefile.git
86+
git fetch --recurse-submodules=no
87+
git checkout origin/master -- Makefile.git
8288
make public
8389
git reset --hard
8490
git pull
8591
cp PACKAGES.minimal PACKAGES
86-
eval $(opam env)
8792
opam pin -yn .
8893
opam info -f "depopts:" liquidsoap-core | grep -v osx-secure-transport | xargs opam remove --force -y ffmpeg-avutil cohttp-lwt-unix prometheus-app ${{ needs.build_details.outputs.minimal_exclude_deps }}
8994
echo "::endgroup::"
@@ -180,6 +185,11 @@ jobs:
180185
run: |
181186
apt-get update
182187
apt-get install -y npm
188+
- name: Install pandoc
189+
run: |
190+
cd /tmp
191+
sudo -u opam -E git clone https://github.com/smimram/ocaml-pandoc.git
192+
sudo -u opam -E opam pin -y add ocaml-pandoc
183193
- name: Build doc
184194
env:
185195
CPU_CORES: ${{ steps.cpu_cores.outputs.count }}
@@ -235,6 +245,15 @@ jobs:
235245
sudo -u opam -E git remote set-url origin https://github.com/savonet/liquidsoap.git
236246
sudo -u opam -E git fetch origin ${{ github.sha }}
237247
sudo -u opam -E git checkout ${{ github.sha }}
248+
- name: Install pandoc
249+
run: |
250+
cd /tmp
251+
if [ ! -d ocaml-pandoc ]; then
252+
mkdir -p ocaml-pandoc;
253+
chown -R opam ocaml-pandoc;
254+
sudo -u opam -E git clone https://github.com/smimram/ocaml-pandoc.git ocaml-pandoc
255+
fi
256+
sudo -u opam -E opam pin -y add ocaml-pandoc
238257
- name: Build
239258
env:
240259
CPU_CORES: ${{ steps.cpu_cores.outputs.count }}
@@ -251,8 +270,8 @@ jobs:
251270
- name: Install additional packages
252271
if: matrix.target == '@doctest'
253272
run: |
254-
sudo apt-get -y update
255-
sudo apt-get -y install frei0r-plugins
273+
apt-get -y update
274+
apt-get -y install frei0r-plugins
256275
sudo -u opam -E opam install -y prometheus-liquidsoap
257276
- name: Run tests
258277
env:
@@ -380,6 +399,11 @@ jobs:
380399
if: matrix.os == 'alpine'
381400
run: |
382401
apk -U --force-overwrite upgrade
402+
- name: Install pandoc
403+
run: |
404+
cd /tmp
405+
sudo -u opam -E git clone https://github.com/smimram/ocaml-pandoc.git ocaml-pandoc
406+
sudo -u opam -E opam pin -y add ocaml-pandoc
383407
- name: Build
384408
run: |
385409
cd /tmp/liquidsoap-full/liquidsoap

doc/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ all: dune
66
test: dune
77
@for i in $(MD); do \
88
echo -n "Compiling $$i... "; \
9-
pandoc --filter=pandoc-include --metadata title="bla" --template=template.html $$i -o /tmp/`basename $$i .md`.html; \
9+
pandoc $$i -t json | pandoc-include --directory "content/liq" | pandoc -f json --metadata title="bla" --template=template.html -o /tmp/`basename $$i .md`.html; \
1010
echo "done"; \
1111
done
1212
@dune build @doctest

doc/content/beets.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ We rely on `request.dynamic` to call `beet random`
7575
(with `-f '$path'` option so beets only returns the matching track's path)
7676
every time the source must prepare a new track:
7777

78-
```{.liquidsoap include="content/liq/beets-source.liq" from=1 to=-1}
78+
```{.liquidsoap include="beets-source.liq" from="BEGIN" to="END"}
7979
8080
```
8181

@@ -101,7 +101,7 @@ import:
101101

102102
Then we only need to add `amplify` to our source creation function. In the example below we also add `blank.eat`, to automatically cut silence at the beginning or end of tracks.
103103

104-
```{.liquidsoap include="content/liq/beets-amplify.liq" from=1}
104+
```{.liquidsoap include="beets-amplify.liq" from="BEGIN"}
105105
106106
```
107107

@@ -117,7 +117,7 @@ In that case,
117117
the list of paths returned by `beet random -f '$path'` fits directly
118118
what's needed by protocol resolution:
119119

120-
```{.liquidsoap include="content/liq/beets-protocol.liq" from=1}
120+
```{.liquidsoap include="beets-protocol.liq" from="BEGIN"}
121121
122122
```
123123

doc/content/blank.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ listeners get some silence again. To avoid that problem we made the
2323
(i.e. declare it as unavailable), which perfectly suits the typical setup used
2424
for live shows:
2525

26-
```{.liquidsoap include="content/liq/blank-sorry.liq"}
26+
```{.liquidsoap include="blank-sorry.liq"}
2727
2828
```
2929

@@ -33,6 +33,6 @@ more about liquidsoap's notion of [source](sources.html).
3333
Finally, if you need to do some custom action when there's too much blank, we
3434
have `blank.detect`:
3535

36-
```{.liquidsoap include="content/liq/blank-detect.liq" from=1 to=-1}
36+
```{.liquidsoap include="blank-detect.liq" from=1 to=-1}
3737
3838
```

doc/content/complete_case.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Once you've managed to describe what you want in such a modular way, you're half
1515

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

18-
```{.liquidsoap include="content/liq/complete-case.liq"}
18+
```{.liquidsoap include="complete-case.liq"}
1919
2020
```
2121

doc/content/cookbook.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ When building your stream, you'll often need to make it unfallible. Usually, you
4848

4949
[Liquidsoap](index.html) can achieve basic streaming tasks like transcoding with ease. You input any number of "source" streams using `input.http`, and then transcode them to any number of formats / bitrates / etc. The only limitation is your hardware: encoding and decoding are both heavy on CPU. If you want to get the best use of CPUs (multicore, memory footprint etc.) when encoding media with Liquidsoap, we recommend using the `%ffmpeg` encoders.
5050

51-
```{.liquidsoap include="content/liq/transcoding.liq"}
51+
```{.liquidsoap include="transcoding.liq"}
5252
5353
```
5454

@@ -64,15 +64,15 @@ to encode the file as quickly as possible.
6464
Finally, we use the `on_stop` handler to shutdown
6565
liquidsoap when streaming is finished.
6666

67-
```{.liquidsoap include="content/liq/re-encode.liq"}
67+
```{.liquidsoap include="re-encode.liq"}
6868
6969
```
7070

7171
## RTMP server
7272

7373
With our [FFmpeg support](ffmpeg.html), it is possible to create a simple RTMP server with no re-encoding:
7474

75-
```{.liquidsoap include="content/liq/rtmp.liq"}
75+
```{.liquidsoap include="rtmp.liq"}
7676
7777
```
7878

@@ -83,23 +83,23 @@ the SRT transport protocol:
8383

8484
Sender:
8585

86-
```{.liquidsoap include="content/liq/srt-sender.liq" from=1}
86+
```{.liquidsoap include="srt-sender.liq" from="BEGIN"}
8787
8888
```
8989

9090
Receiver:
9191

92-
```{.liquidsoap include="content/liq/srt-receiver.liq" to=-1}
92+
```{.liquidsoap include="srt-receiver.liq" to="END"}
9393
9494
```
9595

9696
## Scheduling
9797

98-
```{.liquidsoap include="content/liq/fallback.liq" to=-1}
98+
```{.liquidsoap include="fallback.liq" to="END"}
9999
100100
```
101101

102-
```{.liquidsoap include="content/liq/scheduling.liq" from=1 to=-1}
102+
```{.liquidsoap include="scheduling.liq" from="BEGIN" to="END"}
103103
104104
```
105105

@@ -114,7 +114,7 @@ stored to avoid reindexing at each run). The resulting object can then
114114
be queried with the `find` method in order to return all files matching the given
115115
conditions and thus generate a playlist:
116116

117-
```{.liquidsoap include="content/liq/medialib.liq"}
117+
```{.liquidsoap include="medialib.liq"}
118118
119119
```
120120

@@ -160,7 +160,7 @@ It can be useful to have a special playlist that is played at least every 20 min
160160
You may think of a promotional playlist for instance.
161161
Here is the recipe:
162162

163-
```{.liquidsoap include="content/liq/regular.liq" from=1 to=-1}
163+
```{.liquidsoap include="regular.liq" from="BEGIN" to="END"}
164164
165165
```
166166

@@ -277,7 +277,7 @@ to add an extra `5s` of silence when transitioning out of a live `input.harbor`
277277

278278
This can be done with the `append` operator:
279279

280-
```{.liquidsoap include="content/liq/append-silence.liq" to=-1}
280+
```{.liquidsoap include="append-silence.liq" to="END"}
281281
282282
```
283283

@@ -287,14 +287,14 @@ It is sometimes useful (or even legally necessary) to keep a backup of an audio
287287
stream. Storing all the stream in one file can be very impractical. In order to
288288
save a file per hour in wav format, the following script can be used:
289289

290-
```{.liquidsoap include="content/liq/dump-hourly.liq" from=1}
290+
```{.liquidsoap include="dump-hourly.liq" from="BEGIN"}
291291
292292
```
293293

294294
In the following variant we write a new mp3 file each time new metadata is
295295
coming from `s`:
296296

297-
```{.liquidsoap include="content/liq/dump-hourly2.liq" from=1}
297+
```{.liquidsoap include="dump-hourly2.liq" from="BEGIN"}
298298
299299
```
300300

@@ -332,7 +332,7 @@ Crossfade-based transitions are more complex and involve buffering source data i
332332

333333
We provide a default operator named `cross.smart` which may be suitable for most usage. But you can also create your own customized crossfade transitions. This is in particular true if you are expecting crossfade transitions between tracks of your `music` source but not between a `music` track and e.g. some jingles. Here's how to do it in this case:
334334

335-
```{.liquidsoap include="content/liq/cross.smart.liq" from=1 to=-1}
335+
```{.liquidsoap include="cross.smart.liq" from="BEGIN" to="END"}
336336
337337
```
338338

@@ -356,7 +356,7 @@ Could not set buffer size to 'frame.size' (1920 samples), got 2048.
356356

357357
The solution is then to set liquidsoap's internal frame size to this value, which is most likely specific to your hardware. Let's try this script:
358358

359-
```{.liquidsoap include="content/liq/frame-size.liq"}
359+
```{.liquidsoap include="frame-size.liq"}
360360
361361
```
362362

doc/content/crossfade.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can find its documentation in the [language reference](reference.html).
1919

2020
Liquidsoap also includes a ready-to-use operator defined using `cross`, it is called `crossfade` and is defined in the pervasive helper script `utils.liq`. Its code is:
2121

22-
```{.liquidsoap include="content/liq/crossfade.liq"}
22+
```{.liquidsoap include="crossfade.liq"}
2323
2424
```
2525

doc/content/dynamic_sources.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ a dynamic restreaming platform.
1414

1515
Here's the code:
1616

17-
```{.liquidsoap include="content/liq/dynamic-source.liq"}
17+
```{.liquidsoap include="dynamic-source.liq"}
1818
1919
```
2020

doc/content/external_decoders.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ The flac decoder uses the `flac` command line. It is enabled if the binary can b
7979

8080
Its code is the following:
8181

82-
```{.liquidsoap include="content/liq/decoder-flac.liq"}
82+
```{.liquidsoap include="decoder-flac.liq"}
8383
8484
```
8585

8686
Additionally, a metadata resolver is registered when the `metaflac` command can be found in the `$PATH`:
8787

88-
```{.liquidsoap include="content/liq/decoder-metaflac.liq"}
88+
```{.liquidsoap include="decoder-metaflac.liq"}
8989
9090
```
9191

@@ -98,6 +98,6 @@ registered using `decoder.oblivious.add`.
9898

9999
Its code is the following:
100100

101-
```{.liquidsoap include="content/liq/decoder-faad.liq"}
101+
```{.liquidsoap include="decoder-faad.liq"}
102102
103103
```

doc/content/external_encoders.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ Videos can also be encoded by programs able to read files in avi format from
5353
standard input. To use it, the flag `video=true` of `%external` should be
5454
used. For instance, a compressed avi file can be generated with `ffmpeg` using
5555

56-
```{.liquidsoap include="content/liq/external-output.file.liq" from=1}
56+
```{.liquidsoap include="external-output.file.liq" from="BEGIN"}
5757
5858
```

doc/content/external_streams.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ run the external program.
3030
A wrapper, `input.mplayer`, is defined to use mplayer as the external decoder.
3131
Its code is:
3232

33-
```{.liquidsoap include="content/liq/input.mplayer.liq"}
33+
```{.liquidsoap include="input.mplayer.liq"}
3434
3535
```

doc/content/ffmpeg_cookbook.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Here are some examples of what is possible to do with the ffmpeg support in liqu
66

77
With ffmpeg support, Liquidsoap can relay encoded streams without re-encoding them, making it possible to re-send a stream to multiple destinations. Here's an example:
88

9-
```{.liquidsoap include="content/liq/ffmpeg-relay.liq"}
9+
```{.liquidsoap include="ffmpeg-relay.liq"}
1010
1111
```
1212

@@ -25,7 +25,7 @@ In the script below, you need to match the encoded format of the stream with a b
2525
The `output.harbor` will then relay the data from the file if no one is connected and start/stop the underlying
2626
input when there are listeners:
2727

28-
```{.liquidsoap include="content/liq/ffmpeg-relay-ondemand.liq"}
28+
```{.liquidsoap include="ffmpeg-relay-ondemand.liq"}
2929
3030
```
3131

@@ -34,15 +34,15 @@ input when there are listeners:
3434
Liquidsoap can also encode in one place and share the encoded with data with multiple outputs, making it possible to
3535
minimize CPU resources. Here's an example adapted from the previous one:
3636

37-
```{.liquidsoap include="content/liq/ffmpeg-shared-encoding.liq"}
37+
```{.liquidsoap include="ffmpeg-shared-encoding.liq"}
3838
3939
```
4040

4141
Shared encoding is even more useful when dealing with video encoding, which is very costly. Here's a fun example
4242
sharing audio and video encoding and sending to different destinations, both via Icecast and to YouTube/Facebook
4343
via the rtmp protocol:
4444

45-
```{.liquidsoap include="content/liq/ffmpeg-shared-encoding-rtmp.liq"}
45+
```{.liquidsoap include="ffmpeg-shared-encoding-rtmp.liq"}
4646
4747
```
4848

@@ -63,7 +63,7 @@ to adapt the binary data and, it's possible some new filters will need to be wri
6363

6464
Here's a use case that has been tested: live switch between a playlist of mp4 files and a rtmp flv input:
6565

66-
```{.liquidsoap include="content/liq/live-switch.liq"}
66+
```{.liquidsoap include="live-switch.liq"}
6767
6868
```
6969

0 commit comments

Comments
 (0)