Skip to content

Commit ef70830

Browse files
Move the doc site download to a submodule (#18)
Ali Ayas has already made a clean version, and we can guarantee consistent output by relying on certain versions of the site.
1 parent f3470f2 commit ef70830

File tree

9 files changed

+36
-33
lines changed

9 files changed

+36
-33
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference
2+
3+
# Source - https://stackoverflow.com/a/73229032
4+
# Posted by aknosis
5+
# Retrieved 2025-11-07, License - CC BY-SA 4.0
6+
7+
version: 2
8+
9+
updates:
10+
- package-ecosystem: gitsubmodule
11+
schedule:
12+
interval: daily
13+
directory: /

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
timeout-minutes: 15
88
steps:
99
- uses: actions/checkout@v4
10+
with:
11+
submodules: true
1012

1113
- name: Setup Go
1214
uses: actions/setup-go@v5
@@ -31,4 +33,4 @@ jobs:
3133
uses: actions/upload-artifact@v4
3234
with:
3335
name: sublime-text.docset
34-
path: www.sublimetext.com/sublime-text.docset
36+
path: SublimeText_Documentation/www.sublimetext.com/sublime-text.docset

.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "SublimeText_Documentation"]
2+
path = SublimeText_Documentation
3+
url = https://github.com/maliayas/SublimeText_Documentation
4+
ignore = dirty

Makefile

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,27 @@
1-
source_link := https://www.sublimetext.com/docs/index.html
2-
local_path := www.sublimetext.com
1+
submodule_path := SublimeText_Documentation
2+
local_path := $(submodule_path)/www.sublimetext.com
33
local_index := $(local_path)/docs/index.html
4-
built_path := $(local_path)/sublime-text.docset
4+
docset := sublime-text.docset
5+
dashing_json := $(local_path)/dashing.json
6+
built_path := $(local_path)/$(docset)
57

68
.PHONY: all
7-
all: clean download pre-build build
8-
9-
.PHONY: download
10-
download:
11-
-wget \
12-
--convert-links \
13-
--recursive \
14-
--page-requisites \
15-
--no-parent \
16-
--timestamping \
17-
"$(source_link)"
9+
all: clean pre-build build
1810

1911
.PHONY: fix
20-
pre-build: fix-html fix-css
12+
pre-build: fix-html
2113

2214
.PHONY: fix-html
2315
fix-html:
2416
python fix_html.py
2517

26-
.PHONY: fix-css
27-
fix-css:
28-
$(shell for f in $$(ls $(local_path)/*.*\?*); do mv "$$f" "$${f%\?*}"; done )
29-
$(shell for f in $$(ls $(local_path)/**/*.*\?*); do mv "$$f" "$${f%\?*}"; done )
30-
3118
build:
32-
yq -j . dashing.yml > $(local_path)/dashing.json
19+
yq -j . dashing.yml > $(dashing_json)
3320
cd $(local_path) \
3421
&& dashing build
3522

3623
.PHONY: clean
3724
clean:
38-
-rm -r $(local_path)
39-
40-
.PHONY: clean-more
41-
clean-more: clean
42-
-rm -r $(built_path)
25+
[ -d "$(built_path)" ] && rm -r $(built_path) || true
26+
[ -f "$(dashing_json)" ] && rm $(dashing_json) || true
27+
git restore $(submodule_path) --recurse-submodules

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ We hope to have a distribution channel [eventually][distribution].
3838
* `make`
3939
* [`dashing`][dashing]
4040
* `yq`
41-
* `wget`
4241
* Python 3.8+
4342

4443
### Steps

SublimeText_Documentation

dashing.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Sublime Text
22
package: sublime-text
3-
index: www.sublimetext.com/docs/index.html
4-
icon32x32: favicon.png
3+
index: docs/index.html
4+
icon32x32: ../../favicon.png
55
allowJS: false
6-
ExternalURL: ''
6+
ExternalURL: 'https://www.sublimetext.com'
77
ignore:
88
- id
99
- id0

fix_html.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from bs4 import BeautifulSoup
1010

11-
DOC_ROOT = 'www.sublimetext.com/docs'
11+
DOC_ROOT = 'SublimeText_Documentation/www.sublimetext.com/docs'
1212

1313

1414
def delete_skins(soup):

0 commit comments

Comments
 (0)