@@ -47,11 +47,8 @@ working with Elisp packages, Elisp Repo Kit provides shortcuts:
47
47
48
48
** File contents and structure
49
49
#+cindex: project layout
50
-
51
50
/After cloning and renaming,/ you will have a file tree like this:
52
-
53
51
#+begin_src shell
54
-
55
52
├── .gitignore # ignores for byte compiles, autoloads etc
56
53
│
57
54
├── README.md # this file
@@ -80,11 +77,9 @@ working with Elisp packages, Elisp Repo Kit provides shortcuts:
80
77
│
81
78
└── test
82
79
└── erk-test.el # ERT unit tests for the package
83
-
84
80
#+end_src
85
-
86
81
You can use either a multi-file or flat layout for lisp. Just name test files
87
- ~something-test .el~ and keep all lisp files in root, ~/lisp~ or ~/test~
82
+ ~something-tests .el~ and keep all lisp files in root, ~/lisp~ or ~/test~
88
83
directories.
89
84
** Developing
90
85
- The package is stored in /lisp and its tests in /test.
@@ -113,9 +108,7 @@ working with Elisp packages, Elisp Repo Kit provides shortcuts:
113
108
package is made available on MELPA partly to maintain the structure and
114
109
workflows for doing so.
115
110
* Install ERK
116
-
117
111
#+begin_src elisp
118
-
119
112
(use-package erk) ; vanilla, assuming you have MELPA configured
120
113
121
114
;; using elpaca's with explicit recipe
@@ -127,38 +120,20 @@ working with Elisp packages, Elisp Repo Kit provides shortcuts:
127
120
:straight (erk :type git :host github :repo "positron-solutions/elisp-repo-kit"))
128
121
129
122
;; or use manual load-path & require, you brave yak shaver
130
-
131
123
#+end_src
132
-
133
- ** Manual cloning
134
-
135
- #+findex: erk-clone
136
- The standalone command, ~erk-clone~ will clone without renaming.
137
-
138
- #+findex: erk-rename
139
- If you create via [[https://github.com/positron-solutions/erk-basic][a template]] or clone manually, it's presumed you know what
140
- you're doing at that point. Call ~erk-rename~ on its own to rename in these
141
- cases.
142
-
143
- There are some customize options that cause the renaming to be transitively
144
- consistent.
145
-
146
124
** Manually add just CI
147
-
148
- Copy the .github folder and the contributing guide to your package. Set up
149
- your secrets for Cachix. Read the CI customization section.
150
-
125
+ Copy the .github folder and the contributing guide to your package. Set up
126
+ your secrets for Cachix. Read the CI customization section.
151
127
* Creating Packages
152
-
153
128
#+findex: erk-new
154
129
The simplest and intended way is to call ~erk-new~. It will first
155
130
ask you for:
156
131
157
132
- Choose a template
158
133
- Root directory you want to clone to
159
134
- Package title
160
- - Package feature
161
- - Package prefix
135
+ - Package feature name
136
+ - Package elisp prefix
162
137
- Author name
163
138
- Email address
164
139
- GitHub user or organization
@@ -194,10 +169,16 @@ do-what-I-mean (DWIM).
194
169
the function definition. If it fails, it will fall back to jumping to the
195
170
feature.
196
171
** Run tests
197
- #+findex: erk-ert-project~
198
- ~erk-ert-project~ will discover, rebuild & reload if necessary, and run
199
- tests. There are a few other commands to augment the [[https://www.gnu.org/software/emacs/manual/html_node/ert/][ert]] package.
172
+ *Warning*! These commands are very likely to completely change. If you want to
173
+ try changing them, go ahead. Binding them is not recommended, but they do work.
174
+
175
+ #+findex: erk-ert-project
176
+ - ~erk-ert-project~ will discover, rebuild & reload if necessary, and run tests.
177
+ There are a few other commands to augment the [[https://www.gnu.org/software/emacs/manual/html_node/ert/][ert]] package.
200
178
179
+ #+findex: erk-ert-rerun-this
180
+ - ~erk-ert-rerun-this~ Is not a very smart function yet, but if you are working on
181
+ a test at point, it will run it or re-run it.
201
182
** Duplicating CI Locally
202
183
The CI configuration is all stored in [[file:./.github/][.github]]. Usually you will want
203
184
development instructions in your new repository. The [[file:./CONTRIBUTING.md][CONTRIBUTING]] guide
@@ -235,7 +216,6 @@ do-what-I-mean (DWIM).
235
216
- ~erk-find-find-doc-manual~
236
217
#+findex: erk-find-doc-readme
237
218
- ~erk-find-doc-readme~
238
-
239
219
* Documenting Your Package
240
220
#+cindex: document re-structuring
241
221
#+cindex: document export
@@ -356,7 +336,6 @@ overview:
356
336
(let ((truth "Source blocks will render inside the manual like this"))
357
337
(message true))
358
338
#+end_src
359
-
360
339
You can use ~org-insert-structure-template~ etc to create these easily.
361
340
*** Links :item:
362
341
Hyperlinks thankfully can be written like you expect, though many org
@@ -366,7 +345,6 @@ overview:
366
345
367
346
The syntax is =[[http://somewhere.com][label for my link]]= if you are
368
347
unfamiliar.
369
- ** Indices
370
348
#+cindex: document indices
371
349
Texi has a lot of built-in support for indexes. Until we have GPT for your
372
350
manual, indexes are a good way to provide alternative views into your
@@ -388,14 +366,11 @@ overview:
388
366
You can also declare a new index with @defindex or @defcodeindex. The only
389
367
difference is that a code index will render entries in monospace, like
390
368
code.
391
-
392
369
#+begin_src org
393
370
#+TEXINFO_HEADER: @defindex foo
394
371
#+TEXINFO_HEADER: @defcodeindex foo
395
372
#+end_src
396
-
397
373
Creating entries with a custom index could be tricky. Good luck!
398
-
399
374
*** Adding Entries :item:
400
375
401
376
Quoting a symbol will not result in an index entry. Which quoted symbol
@@ -416,14 +391,12 @@ overview:
416
391
417
392
*** Render the Index :item:
418
393
Just use a regular header like so:
419
-
420
394
#+begin_src org
421
395
,** Keystroke index
422
396
:PROPERTIES:
423
397
:INDEX: ky
424
398
:END:
425
399
#+end_src
426
-
427
400
The built-in index keys are =ky=, =fn=, =vr=, =cp=, =pg=, and =tp=.
428
401
* Distributing Your Package
429
402
** Setting Up Your Github Repository
@@ -437,21 +410,19 @@ overview:
437
410
assignment.
438
411
- [ ] Sign up for [[https://app.cachix.org/][cachix]] and, create a binary cache with API tokens and public
439
412
read access
440
- #+cindex nix enabling cachix
441
- #+cindex github adding secrets
413
+ #+cindex: nix enabling cachix
414
+ #+cindex: github adding secrets
442
415
- [ ] Add repository secrets necessary for your GitHub actions
443
416
~CACHIX_AUTH_TOKEN~ and ~CACHIX_CACHE_NAME~ (settings -> secrets -> new
444
417
repository secret)
445
- #+cindex github allowed actions
418
+ #+cindex: github allowed actions
446
419
- [ ] Enable actions and add the following actions to your allowed actions list:
447
420
448
421
#+begin_src txt
449
-
450
422
actions/checkout@v3.2.0,
451
423
cachix/cachix-action@v12,
452
424
cachix/install-nix-action@v20,
453
425
actions/setup-python@v4,
454
-
455
426
#+end_src
456
427
457
428
*Note*, Python is used to run a DCO check script, nothing more.
@@ -606,7 +577,6 @@ overview:
606
577
If everything works, you are ready to make a pull request to MELPA. Push your
607
578
changes and check all the boxes in the PR template except the one that requires
608
579
you to read the instructions.
609
-
610
580
* Maintaining Your Package
611
581
Keeping your project fresh.
612
582
** Upgrading ERK
@@ -650,7 +620,6 @@ overview:
650
620
By using Nix, your repository can declare a fixed set of dependencies for
651
621
development and testing. Not just Elisp dependencies, but also 3rd party
652
622
dependencies.
653
-
654
623
*** Maintaining versions
655
624
#+cindex: nix dependency updating
656
625
@@ -683,7 +652,6 @@ overview:
683
652
version of the flake in the ~nix repl~:
684
653
685
654
#+begin_src nix
686
-
687
655
# <nixpkgs> is known in your flake registry
688
656
pkgs = import <nixpkgs> { system = builtins.currentSystem; overlays = [ (builtins.getFlake ("emacs-overlay")).overlay ];}
689
657
@@ -695,14 +663,12 @@ overview:
695
663
696
664
# Have fun inspecting the various versions. Checking their declarations in
697
665
# emacs-overlay source can be insightful.
698
-
699
666
#+end_src
700
667
701
668
To obtain truly specific Emacs versions, specify the Emacs source as a flake
702
669
input and then override the attributes of an Emacs package:
703
670
704
671
#+begin_src nix
705
-
706
672
inputs = {
707
673
# declare the exact source you want
708
674
emacs29-src = {
@@ -720,7 +686,6 @@ overview:
720
686
});
721
687
# It's nix expressions. It's programming.
722
688
# Ask your favorite large langauge model!
723
-
724
689
#+end_src
725
690
726
691
#+cindex: nix binary cache
@@ -753,17 +718,46 @@ overview:
753
718
By changing the versions within the flake to match the versions in question
754
719
that are breaking, the user can try versions to confirm a version mismatch and
755
720
then give you their flake so that you can reproduce and confirm a fix.
756
-
721
+ * Configuring ERK
722
+ #+vindex: erk-after-new-hook
723
+ ~erk-after-new-hook~ will be run after you create a new repository. The
724
+ ~default-directory~ is set to the newly cloned directory. By default it runs
725
+ ~magit-status~, where you can check the renaming results.
726
+ * Conventions
727
+ #+cindex: conventions
728
+ ERK relies on [[info:elisp#Packaging][(elisp)standard practices]] to discover files.
729
+ - Feature names always match file names
730
+ - Elisp prefixes are consistent throughout the entire package
731
+ - The project is either all flat or all nested:
732
+ + tests in =/test=
733
+ + package lisp in =/lisp=
734
+ + documenation inputs in =/doc=
735
+ - Tests for a feature are found in the same feature + =-test=.
736
+ - Unit tests are always named after the function they test, ending in =-test=
737
+ - Documentation generation expects:
738
+ + CONTRIBUTING.org
739
+ + manual.org
740
+ + README.org
741
+ - Emacs will only install your manual by default if it exports to
742
+ =my-feature.texi=
743
+
744
+ Files that can vary based on the hosting platform often must use another
745
+ convention, such as =/.github=. Tools expect mostly rigid names such as =flake.nix=
746
+ and =/.git=.
747
+
748
+ If you create a new template, please respect this very simple standard, which is
749
+ also expected by package managers like ~elpaca~ and ~straight~.
750
+ >>>>>>> c0ebedf (fixup! Doc cleanups for version bump)
757
751
* Indices
758
752
** Command and Function index
759
- :PROPERTIES:
760
- :INDEX: fn
761
- :END:
753
+ :PROPERTIES:
754
+ :INDEX: fn
755
+ :END:
762
756
763
757
** Concept index
764
- :PROPERTIES:
765
- :INDEX: cp
766
- :END:
758
+ :PROPERTIES:
759
+ :INDEX: cp
760
+ :END:
767
761
768
762
* Licensing
769
763
:PROPERTIES:
0 commit comments