Skip to content

Commit

Permalink
Merge pull request #37 from sphinx-notes/dev/2.0
Browse files Browse the repository at this point in the history
Merge dev/2.0
  • Loading branch information
SilverRainZ committed Aug 19, 2023
2 parents 6355469 + f6ca2cd commit 230437c
Show file tree
Hide file tree
Showing 21 changed files with 346 additions and 389 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"full_name": "sphinxnotes-lilypond",
"author": "Shengyu Zhang",
"description": "Sphinx extension for embedding LilyPond scores",
"version": "1.6.1",
"version": "2.0.0",
"github_owner": "sphinx-notes",
"github_repo": "lilypond",
"pypi_name": "sphinxnotes-lilypond",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
sudo locale-gen en_US.UTF-8
sudo update-locale
sudo apt-get update;
sudo apt-get install lilypond timidity imagemagick fonts-noto-cjk
sudo apt-get install lilypond timidity fonts-noto-cjk
- uses: actions/checkout@master
with:
fetch-depth: 0
Expand Down
8 changes: 8 additions & 0 deletions docs/_scores/jianpu-directive.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. jianpu::

title=C Major Scale
1=C
2/4
4=60

1 2 3 4 5 6 7 1'
1 change: 1 addition & 0 deletions docs/_scores/jianpuinclude-directive.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. jianpuinclude:: /_scores/songbie.jianpu
7 changes: 3 additions & 4 deletions docs/_scores/lily-directive-c-major-scale.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.. lily::
:noedge:
:noheader:
:nofooter:
:audio:

\version "2.20.0"
\header {
Expand All @@ -17,4 +13,7 @@
c' d' e' f' g' a' b' c''
}
>>

\midi {}
\layout {}
}
6 changes: 3 additions & 3 deletions docs/_scores/lily-directive.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.. lily::
:noedge:
:nofooter:
:audio:

\version "2.20.0"
\header {
Expand All @@ -18,4 +15,7 @@
d4 r r r
}
>>

\layout {}
\midi {}
}
3 changes: 0 additions & 3 deletions docs/_scores/lilyinclude-directive.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
.. lilyinclude:: /_scores/witch-spring.ly
:nofooter:
:noedge:
:audio:
31 changes: 19 additions & 12 deletions docs/_scores/minuet-in-g.ly
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@
composer = "Christian Petzold"
}

\relative c'' {
\time 3/4
\tempo 4 = 120
\key g \major
\score {
<<
\relative c'' {
\time 3/4
\tempo 4 = 120
\key g \major

d4 g,8 a b c
d4 g, g
e'4 c8 d e fis
g4 g, g
d4 g,8 a b c
d4 g, g
e'4 c8 d e fis
g4 g, g

c4 d8 c b a
b4 d8 c b a
fis4 g8 a b g
a2.
c4 d8 c b a
b4 d8 c b a
fis4 g8 a b g
a2.
}
>>

\midi {}
\layout {}
}
23 changes: 23 additions & 0 deletions docs/_scores/songbie.jianpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
% http://ssb22.user.srcf.net/mwrhome/jianpu-ly.html

title=送别
4=80
1=A
4/4

5 q3 q5 1' -
6 q1' q6 5 -
5 q1 q2 3 q2 q1
2 - - 0
5 q3 q5 1'. q7
6 1' 5 -
5 q2 q3 4. q7,
1 - . 0
6 1' 1' 0
7 q6 q7 1' 0
q6 q7 q1' q6 q6 q5 q3 q1
2 - . 0
5 q3 q5 1'. q7
6 1' 5 -
5 q2 q3 4. q7,
1 - . 0
44 changes: 39 additions & 5 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,40 @@ Change Log
Change log here.
Version 2.x
-----------

.. version:: 2.0.0
:date: 2023-08-18

.. todo https://github.com/sphinx-notes/any/issues/21
.. warning:: This release introduces some BREAKING changes.

- **BREAKING** changes:

- Drop ``:noheader``, ``:nofooter:`` options. User should modifying their Lilypond
source to removing header and footer of scores, see `Custom titles headers and footers`__
for more details (:issue:`35`)
- Drop ``:noedge:`` option and introduce ``:nocrop:`` with opposite meaning compared to before.
It is said that score is croppped (noedge) by default
By the way, dependencies to Wand and ImageMagick are dropped (:issue:`31`)
- Drop ``:audio:`` option and introduce ``:noaudio:`` with opposite meaning compared to before.
Audio will be auto-generated when any `MIDI output`__ avaliable, and user set `:noaudio:`
only when they don't need this behavior (:pull:`36`)

- Enhanced Jianpu support (:issue:`30`)

- Don't panic when Jianpu parsing failed
- Can display multiple Jianpu scores, see also `jianpu-ly#35`__
- Audio works fine now

- Score image generataion is reproducible now (:issue:`10`)

__ https://lilypond.org/doc/Documentation/notation/creating-titles-headers-and-footers
__ https://lilypond.org/doc/Documentation/notation/the-midi-block
__ https://github.com/ssb22/jianpu-ly/issues/35

Version 1.x
-----------

Expand All @@ -36,7 +70,7 @@ Version 1.x
- Add LaTeX builder suppport (:issue:`11`)

.. version:: 1.4
:date: 2021-12-19
:date: 2021-12-19

- Note ly files as dependencies, so Sphinx will rebuild document when ly file changes
- Won't crash when score file does not exist
Expand All @@ -46,7 +80,7 @@ Version 1.x
.. _FFmpeg: https://ffmpeg.org/

.. version:: 1.3
:date: 2021-11-07
:date: 2021-11-07

- Add ``controls`` flag for specifing the position of the control bar

Expand All @@ -65,7 +99,7 @@ Version 1.x
- Stop using ``<figure>`` as container of block-level score, which is buggy on Safari

.. version:: 1.0
:date: 2021-06-26
:date: 2021-06-26

- Rebuild env when configuration changed
- Fix wrong license value
Expand All @@ -74,13 +108,13 @@ Pre-release
-----------

.. version:: 1.0a2
:date: 2020-12-27
:date: 2020-12-27

- Support multiple pages documents
- Imporve of lilypond outputs cache

.. version:: 1.0a1
:date: 2020-12-26
:date: 2020-12-26

- Fix invalid insertion of ``\header``
- Set default audio format to wav
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
copyright = "2023, " + author

# The full version, including alpha/beta/rc tags
version = release = '1.6.1'
version = release = '2.0.0'

# -- General configuration ---------------------------------------------------

Expand Down
3 changes: 0 additions & 3 deletions docs/conf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ Configuration

.. versionadded:: 1.4

:lilypond_magick_home: (Type: ``str``, Default: ``None``)
Path to `ImageMagick`_ library.
:lilypond_score_format: (Type: ``str``, Default: ``'png'``)
Format of outputed scores, available values: ``['png', 'svg', 'pdf', 'eps']``.
:lilypond_audio_format: (Type: ``str``, Default: ``'wav'``)
Expand Down Expand Up @@ -43,5 +41,4 @@ Configuration
.. _LilyPond: https://lilypond.org/
.. _FFmpeg: https://ffmpeg.org/
.. _Timidity++: http://timidity.sourceforge.net/
.. _ImageMagick: https://imagemagick.org/index.php
.. _CSS height: https://developer.mozilla.org/en-US/docs/Web/CSS/height
76 changes: 12 additions & 64 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,31 @@ Examples
The LilyPond documentation used in example can be downloaded here:
:download:`/_scores/minuet-in-g.ly`.

.. _example-nocrop:

Original paper size
===================

.. code-block:: rst
.. lilyinclude:: /_scores/minuet-in-g.ly
:nocrop:
.. lilyinclude:: /_scores/minuet-in-g.ly

Paper without Footer and Edge
=============================

.. code-block:: rst
.. lilyinclude:: /_scores/minuet-in-g.ly
:nofooter:
:noedge:
.. lilyinclude:: /_scores/minuet-in-g.ly
:nofooter:
:noedge:
:nocrop:

Smallest Paper Size
===================
.. _example-noaudio:

.. code-block:: rst
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:

.. _example-audio-preview:

Audio Preview
Disable Audio
=============

.. code-block:: rst
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
:audio:
:noaudio:
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
:audio:
:noaudio:

.. _example-transposing:

Expand All @@ -69,17 +39,9 @@ Transposing
.. code-block:: rst
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
:audio:
:transpose: g c
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
:audio:
:transpose: g c

Multiple Pages
Expand All @@ -88,12 +50,8 @@ Multiple Pages
.. code-block:: rst
.. lilyinclude:: /_scores/alice.ly
:noedge:
:audio:
.. lilyinclude:: /_scores/alice.ly
:noedge:
:audio:

Loop
====
Expand All @@ -103,15 +61,9 @@ Loop
.. code-block:: rst
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
:loop:
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
:loop:

Control Bar at the Top
Expand All @@ -122,38 +74,34 @@ Control Bar at the Top
.. code-block:: rst
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
:controls: top
.. lilyinclude:: /_scores/minuet-in-g.ly
:noheader:
:nofooter:
:noedge:
:controls: top

Jianpu (Numbered Musical Notation)
==================================

.. versionadded:: 1.5

.. seealso:: :ref:`jianpu-directive`.

.. code-block:: rst
.. jianpu::
%% tempo: 4=60
title=C Major Scale
1=C
4=60
2/4
1 2 3 4 5 6 7 1'
.. jianpu::

%% tempo: 4=60
title=C Major Scale
1=C
4=60
2/4

1 2 3 4 5 6 7 1'

0 comments on commit 230437c

Please sign in to comment.