From 3f047eef5b84c4212da865b5cdadb70076f07805 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 17 Aug 2021 22:49:10 +0200 Subject: Add comments for shortcuts and extract them for the manual (#2073). --- doc/manual/Makefile | 7 ++++++- doc/manual/dcpomatic.xml | 39 +-------------------------------------- doc/manual/shortcuts.py | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 doc/manual/shortcuts.py (limited to 'doc') diff --git a/doc/manual/Makefile b/doc/manual/Makefile index 6e2c12d41..d57dd2630 100644 --- a/doc/manual/Makefile +++ b/doc/manual/Makefile @@ -99,11 +99,16 @@ diagrams/%.pdf: diagrams/%.svg config.xml: ../../src/lib/config.cc config.py python3 config.py ../../src/lib/config.cc > config.xml +SHORTCUTS := ../../src/tools/dcpomatic.cc + +shortcuts.xml: $(SHORTCUTS) shortcuts.py + python3 shortcuts.py $(SHORTCUTS) > $@ + # # HTML # -html: $(XML) config.xml dcpomatic-html.xsl extensions-html.ent dcpomatic.css dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \ +html: $(XML) config.xml shortcuts.xml dcpomatic-html.xsl extensions-html.ent dcpomatic.css dcpomatic_create.xml dcpomatic_cli.xml dcpomatic_kdm_cli.xml \ $(subst .pdf,.png,$(addprefix html/screenshots/,$(SCREENSHOTS))) \ $(subst .svg,.png,$(addprefix diagrams/,$(DIAGRAMS))) \ diff --git a/doc/manual/dcpomatic.xml b/doc/manual/dcpomatic.xml index 4fd17dd6d..797a49fe5 100644 --- a/doc/manual/dcpomatic.xml +++ b/doc/manual/dcpomatic.xml @@ -3779,44 +3779,7 @@ The full details of OV and VF files are discussed in Keyboard shortcuts - - - Keyboard shortcuts - - - - Key - Action - - - - - Space - Start / stop playback - - - Delete - Remove content from film - - - Left arrow - Move back one frame - - - Right arrow - Move forward one frame - - - Ctrl+A - Add file(s) to film - - - Ctrl+T - Open timeline window - - - -
+
diff --git a/doc/manual/shortcuts.py b/doc/manual/shortcuts.py new file mode 100644 index 000000000..a18786799 --- /dev/null +++ b/doc/manual/shortcuts.py @@ -0,0 +1,40 @@ +import sys + +shortcuts = [] + +for filename in sys.argv[1:]: + with open(filename) as f: + for line in f: + line = line.strip(); + if line.startswith('/* [Shortcut] '): + desc = line[14:-2].strip() + parts = desc.split(':') + shortcuts.append(desc.split(':')) + +shortcuts.sort(key=lambda x: x[0]) + +print(""" + + Keyboard shortcuts + + + + Key + Action + + + +""") + +for s in shortcuts: + print(" ") + print(f" {s[0]}") + print(f" {s[1]}") + print(" ") + +print(""" + + +
+""") + -- cgit v1.2.3