summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-09-14 13:43:25 -0400
committerLouie S <louie@example.com>2023-09-14 13:43:25 -0400
commitbc3a8e65382af25a44049d1de8fa96647cd325e1 (patch)
treecb68b14921ba482108850a3e7627d91c9592ea26
parent24630a5f215cfc949bac6faa9864b8ed29ee4594 (diff)
Basic texinfo dash docset
-rw-r--r--.gitignore2
-rw-r--r--Makefile80
-rw-r--r--README19
-rw-r--r--README.md33
-rw-r--r--README.template17
-rw-r--r--src/icon.pngbin0 -> 1617 bytes
-rwxr-xr-xsrc/index.sh1
-rw-r--r--src/texinfo/Info.plist (renamed from src/Info.plist)6
-rw-r--r--texinfo-Makefile80
9 files changed, 110 insertions, 128 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..04a60da
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+tmp
+*.docset
diff --git a/Makefile b/Makefile
index 9339745..f1ac14b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,79 +1,9 @@
-#DOCSET_NAME = ...
-DOCSET_DIR = $(DOCSET_NAME).docset
-CONTENTS_DIR = $(DOCSET_DIR)/Contents
-RESOURCES_DIR = $(CONTENTS_DIR)/Resources
-DOCUMENTS_DIR = $(RESOURCES_DIR)/Documents
+all: texinfo
-INFO_PLIST_FILE = $(CONTENTS_DIR)/Info.plist
-INDEX_FILE = $(RESOURCES_DIR)/docSet.dsidx
-ICON_FILE = $(DOCSET_DIR)/icon.png
-ARCHIVE_FILE = $(DOCSET_NAME).tgz
-
-#SRC_ICON = src/icon.png
-
-#MANUAL_URL = ...
-#MANUAL_FILE = tmp/...
-
-ERROR_DOCSET_NAME = $(error DOCSET_NAME is unset)
-WARNING_MANUAL_URL = $(warning MANUAL_URL is unset)
-ERROR_MANUAL_FILE = $(error MANUAL_FILE is unset)
-.phony: err warn
-
-ifndef DOCSET_NAME
-err: ; $(ERROR_DOCSET_NAME)
-endif
-
-ifndef MANUAL_FILE
-err: ; $(ERROR_MANUAL_FILE)
-endif
-
-ifndef MANUAL_URL
-warn:
- $(WARNING_MANUAL_URL)
- $(MAKE) all
-endif
-
-DOCSET = $(INFO_PLIST_FILE) $(INDEX_FILE)
-ifdef SRC_ICON
-DOCSET += $(ICON_FILE)
-endif
-
-all: $(DOCSET)
-
-archive: $(ARCHIVE_FILE)
+texinfo:
+ $(MAKE) -f texinfo-Makefile
+.PHONY: clean
clean:
- rm -rf $(DOCSET_DIR) $(ARCHIVE_FILE)
-
-tmp:
- mkdir -p $@
-
-$(ARCHIVE_FILE): $(DOCSET)
- tar --exclude='.DS_Store' -czf $@ $(DOCSET_DIR)
-
-$(MANUAL_FILE): tmp
- curl -o $@ $(MANUAL_URL)
-
-$(DOCSET_DIR):
- mkdir -p $@
-
-$(CONTENTS_DIR): $(DOCSET_DIR)
- mkdir -p $@
-
-$(RESOURCES_DIR): $(CONTENTS_DIR)
- mkdir -p $@
-
-$(DOCUMENTS_DIR): $(RESOURCES_DIR) $(MANUAL_FILE)
- mkdir -p $@
- tar -x -z -f $(MANUAL_FILE) -C $@
-
-$(INFO_PLIST_FILE): src/Info.plist $(CONTENTS_DIR)
- cp src/Info.plist $@
-
-$(INDEX_FILE): src/index.sh $(DOCUMENTS_DIR)
- rm -f $@
- src/index.sh $@ $(DOCUMENTS_DIR)/*.html
-
-$(ICON_FILE): src/icon.png $(DOCSET_DIR)
- cp $(SRC_ICON) $@
+ $(MAKE) clean -f texinfo-Makefile
diff --git a/README b/README
new file mode 100644
index 0000000..162faaa
--- /dev/null
+++ b/README
@@ -0,0 +1,19 @@
+Here is a script and a Makefile for generating GNU Texinfo-related docsets for Dash. The script is based on the dash-docset-generation-template
+
+- GNU Texinfo: https://www.gnu.org/software/texinfo/
+- Dash: https://kapeli.com/dash
+- dash-docset-generation-template: https://github.com/lshprung/dash-docset-generation-template
+
+To generate docsets from the latest edition of the GNU Texinfo Manual
+and the Standalone Info Reader Manual, simply execute `make` from the
+same directory as this README file.
+The latest edition will be downloaded from www.gnu.org and packaged
+appropriately.
+
+Requirements:
+
+- any POSIX-compliant shell
+- curl - https://curl.se/
+- make - https://www.gnu.org/software/make/
+- pup - https://github.com/ericchiang/pup
+- sqlite3 - https://www.sqlite.org/index.html
diff --git a/README.md b/README.md
deleted file mode 100644
index 774f7de..0000000
--- a/README.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Dash Docset Template
-
-This is a repository providing a template to package a Dash docset from HTML source documentation. Files that need to be manually configured are listed below. Additional fine tuning is also recommended, depending on the quirks of the documentation being packaged. An example docset packaging script for GNU Make using this template can be seen [here](https://github.com/lshprung/gnu-make-dash-docset)
-
-### `README.template`
-
-This file will provide a README for the packaging script. Replace `<NAME>`, `<UPSTREAM LINK>`, and `<UPSTREAM HOST>` with appropriate values.
-
-### `Makefile`
-
-This file will build the docset.
-
-- `DOCSET_NAME` must be set
-- `MANUAL_FILE` must be set
- - If the script should download documentation from the internet, `MANUAL_URL` must also be set. If not, ensure a `.tgz` archive of the HTML documentation exists at `tmp/MANUAL.tgz` (where MANUAL is the name of the archive)
-
-### `src/icon.png`
-
-If you want to associate an icon with the docset, it should be saved to `src/icon.png`. Make sure to uncomment the corresponding line in `Makefile` to include the icon in the docset.
-
-### `src/index.sh`
-
-This is the main script that builds the docset index. This script does not require any manual modifications, but you will probably want to make additions/changes to improve the quality of your docset and accomodate any quirks.
-
-### `src/Info.plist`
-
-This file contains metadata for the docset. Replace `<!-- VALUE -->` with appropriate values. It may be useful to refer to the `Info.plist` file of an existing docset for reference.
-
----
-
-### Credits
-
-Created by [lshprung](https://github.com/lshprung), and originally based on [benzado](https://github.com/benzado)'s [gnu-make-dash-docset](https://github.com/benzado/gnu-make-dash-docset).
diff --git a/README.template b/README.template
deleted file mode 100644
index 5d08037..0000000
--- a/README.template
+++ /dev/null
@@ -1,17 +0,0 @@
-Here is a script and a Makefile for generating a <NAME> docset for Dash. The script is based on the dash-docset-generation-template
-
-- <NAME>: <UPSTREAM LINK>
-- Dash: https://kapeli.com/dash
-- dash-docset-generation-template: https://github.com/lshprung/dash-docset-generation-template
-
-To generate a docset from the latest edition of the <NAME> Manual, simply
-execute `make` from the same directory as this README file. The latest edition
-will be downloaded from <UPSTREAM HOST> and packaged appropriately.
-
-Requirements:
-
-- any POSIX-compliant shell
-- curl - https://curl.se/
-- make - https://www.gnu.org/software/make/
-- pup - https://github.com/ericchiang/pup
-- sqlite3 - https://www.sqlite.org/index.html
diff --git a/src/icon.png b/src/icon.png
new file mode 100644
index 0000000..9b18522
--- /dev/null
+++ b/src/icon.png
Binary files differ
diff --git a/src/index.sh b/src/index.sh
index 0b6e693..7a1b60d 100755
--- a/src/index.sh
+++ b/src/index.sh
@@ -13,6 +13,7 @@ get_title() {
pup -p -f "$FILE" 'title text{}' | \
tr -d \\n | \
+ sed 's/(GNU[^)]*)$//' | \
sed 's/\"/\"\"/g'
}
diff --git a/src/Info.plist b/src/texinfo/Info.plist
index 111baae..c240c76 100644
--- a/src/Info.plist
+++ b/src/texinfo/Info.plist
@@ -3,11 +3,11 @@
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
- <string><!-- VALUE --></string>
+ <string>gnutexinfo</string>
<key>CFBundleName</key>
- <string><!-- VALUE --></string>
+ <string>GNU Texinfo</string>
<key>DocSetPlatformFamily</key>
- <string><!-- VALUE --></string>
+ <string>texinfo</string>
<key>isDashDocset</key>
<true/>
</dict>
diff --git a/texinfo-Makefile b/texinfo-Makefile
new file mode 100644
index 0000000..d41a6a1
--- /dev/null
+++ b/texinfo-Makefile
@@ -0,0 +1,80 @@
+DOCSET_NAME = GNU_Texinfo
+
+DOCSET_DIR = $(DOCSET_NAME).docset
+CONTENTS_DIR = $(DOCSET_DIR)/Contents
+RESOURCES_DIR = $(CONTENTS_DIR)/Resources
+DOCUMENTS_DIR = $(RESOURCES_DIR)/Documents
+
+INFO_PLIST_FILE = $(CONTENTS_DIR)/Info.plist
+INDEX_FILE = $(RESOURCES_DIR)/docSet.dsidx
+ICON_FILE = $(DOCSET_DIR)/icon.png
+ARCHIVE_FILE = $(DOCSET_NAME).tgz
+
+SRC_ICON = src/icon.png
+SRC_PLIST = src/texinfo/Info.plist
+
+MANUAL_URL = https://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html_node.tar.gz
+MANUAL_FILE = tmp/texinfo.html_node.tar.gz
+
+ERROR_DOCSET_NAME = $(error DOCSET_NAME is unset)
+WARNING_MANUAL_URL = $(warning MANUAL_URL is unset)
+ERROR_MANUAL_FILE = $(error MANUAL_FILE is unset)
+.phony: err warn
+
+ifndef DOCSET_NAME
+err: ; $(ERROR_DOCSET_NAME)
+endif
+
+ifndef MANUAL_FILE
+err: ; $(ERROR_MANUAL_FILE)
+endif
+
+ifndef MANUAL_URL
+warn:
+ $(WARNING_MANUAL_URL)
+ $(MAKE) all
+endif
+
+DOCSET = $(INFO_PLIST_FILE) $(INDEX_FILE)
+ifdef SRC_ICON
+DOCSET += $(ICON_FILE)
+endif
+
+all: $(DOCSET)
+
+archive: $(ARCHIVE_FILE)
+
+clean:
+ rm -rf $(DOCSET_DIR) $(ARCHIVE_FILE)
+
+tmp:
+ mkdir -p $@
+
+$(ARCHIVE_FILE): $(DOCSET)
+ tar --exclude='.DS_Store' -czf $@ $(DOCSET_DIR)
+
+$(MANUAL_FILE): tmp
+ curl -o $@ $(MANUAL_URL)
+
+$(DOCSET_DIR):
+ mkdir -p $@
+
+$(CONTENTS_DIR): $(DOCSET_DIR)
+ mkdir -p $@
+
+$(RESOURCES_DIR): $(CONTENTS_DIR)
+ mkdir -p $@
+
+$(DOCUMENTS_DIR): $(RESOURCES_DIR) $(MANUAL_FILE)
+ mkdir -p $@
+ tar -x -z -f $(MANUAL_FILE) -C $@
+
+$(INFO_PLIST_FILE): $(SRC_PLIST) $(CONTENTS_DIR)
+ cp $(SRC_PLIST) $@
+
+$(INDEX_FILE): src/index.sh $(DOCUMENTS_DIR)
+ rm -f $@
+ src/index.sh $@ $(DOCUMENTS_DIR)/*.html
+
+$(ICON_FILE): src/icon.png $(DOCSET_DIR)
+ cp $(SRC_ICON) $@