Skip to content

Commit 5581914

Browse files
committed
Doc cleanups for version bump
Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
1 parent 9481f38 commit 5581914

File tree

2 files changed

+75
-75
lines changed

2 files changed

+75
-75
lines changed

doc/manual.org

Lines changed: 53 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ working with Elisp packages, Elisp Repo Kit provides shortcuts:
4747

4848
** File contents and structure
4949
#+cindex: project layout
50-
5150
/After cloning and renaming,/ you will have a file tree like this:
52-
5351
#+begin_src shell
54-
5552
├── .gitignore # ignores for byte compiles, autoloads etc
5653
5754
├── README.md # this file
@@ -80,11 +77,9 @@ working with Elisp packages, Elisp Repo Kit provides shortcuts:
8077
8178
└── test
8279
└── erk-test.el # ERT unit tests for the package
83-
8480
#+end_src
85-
8681
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~
8883
directories.
8984
** Developing
9085
- The package is stored in /lisp and its tests in /test.
@@ -113,9 +108,7 @@ working with Elisp packages, Elisp Repo Kit provides shortcuts:
113108
package is made available on MELPA partly to maintain the structure and
114109
workflows for doing so.
115110
* Install ERK
116-
117111
#+begin_src elisp
118-
119112
(use-package erk) ; vanilla, assuming you have MELPA configured
120113

121114
;; using elpaca's with explicit recipe
@@ -127,38 +120,20 @@ working with Elisp packages, Elisp Repo Kit provides shortcuts:
127120
:straight (erk :type git :host github :repo "positron-solutions/elisp-repo-kit"))
128121

129122
;; or use manual load-path & require, you brave yak shaver
130-
131123
#+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-
146124
** 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.
151127
* Creating Packages
152-
153128
#+findex: erk-new
154129
The simplest and intended way is to call ~erk-new~. It will first
155130
ask you for:
156131

157132
- Choose a template
158133
- Root directory you want to clone to
159134
- Package title
160-
- Package feature
161-
- Package prefix
135+
- Package feature name
136+
- Package elisp prefix
162137
- Author name
163138
- Email address
164139
- GitHub user or organization
@@ -194,10 +169,16 @@ do-what-I-mean (DWIM).
194169
the function definition. If it fails, it will fall back to jumping to the
195170
feature.
196171
** 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.
200178

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.
201182
** Duplicating CI Locally
202183
The CI configuration is all stored in [[file:./.github/][.github]]. Usually you will want
203184
development instructions in your new repository. The [[file:./CONTRIBUTING.md][CONTRIBUTING]] guide
@@ -235,7 +216,6 @@ do-what-I-mean (DWIM).
235216
- ~erk-find-find-doc-manual~
236217
#+findex: erk-find-doc-readme
237218
- ~erk-find-doc-readme~
238-
239219
* Documenting Your Package
240220
#+cindex: document re-structuring
241221
#+cindex: document export
@@ -356,7 +336,6 @@ overview:
356336
(let ((truth "Source blocks will render inside the manual like this"))
357337
(message true))
358338
#+end_src
359-
360339
You can use ~org-insert-structure-template~ etc to create these easily.
361340
*** Links :item:
362341
Hyperlinks thankfully can be written like you expect, though many org
@@ -366,7 +345,6 @@ overview:
366345

367346
The syntax is =[[http://somewhere.com][label for my link]]= if you are
368347
unfamiliar.
369-
** Indices
370348
#+cindex: document indices
371349
Texi has a lot of built-in support for indexes. Until we have GPT for your
372350
manual, indexes are a good way to provide alternative views into your
@@ -388,14 +366,11 @@ overview:
388366
You can also declare a new index with @defindex or @defcodeindex. The only
389367
difference is that a code index will render entries in monospace, like
390368
code.
391-
392369
#+begin_src org
393370
#+TEXINFO_HEADER: @defindex foo
394371
#+TEXINFO_HEADER: @defcodeindex foo
395372
#+end_src
396-
397373
Creating entries with a custom index could be tricky. Good luck!
398-
399374
*** Adding Entries :item:
400375

401376
Quoting a symbol will not result in an index entry. Which quoted symbol
@@ -416,14 +391,12 @@ overview:
416391

417392
*** Render the Index :item:
418393
Just use a regular header like so:
419-
420394
#+begin_src org
421395
,** Keystroke index
422396
:PROPERTIES:
423397
:INDEX: ky
424398
:END:
425399
#+end_src
426-
427400
The built-in index keys are =ky=, =fn=, =vr=, =cp=, =pg=, and =tp=.
428401
* Distributing Your Package
429402
** Setting Up Your Github Repository
@@ -437,21 +410,19 @@ overview:
437410
assignment.
438411
- [ ] Sign up for [[https://app.cachix.org/][cachix]] and, create a binary cache with API tokens and public
439412
read access
440-
#+cindex nix enabling cachix
441-
#+cindex github adding secrets
413+
#+cindex: nix enabling cachix
414+
#+cindex: github adding secrets
442415
- [ ] Add repository secrets necessary for your GitHub actions
443416
~CACHIX_AUTH_TOKEN~ and ~CACHIX_CACHE_NAME~ (settings -> secrets -> new
444417
repository secret)
445-
#+cindex github allowed actions
418+
#+cindex: github allowed actions
446419
- [ ] Enable actions and add the following actions to your allowed actions list:
447420

448421
#+begin_src txt
449-
450422
actions/checkout@v3.2.0,
451423
cachix/cachix-action@v12,
452424
cachix/install-nix-action@v20,
453425
actions/setup-python@v4,
454-
455426
#+end_src
456427

457428
*Note*, Python is used to run a DCO check script, nothing more.
@@ -606,7 +577,6 @@ overview:
606577
If everything works, you are ready to make a pull request to MELPA. Push your
607578
changes and check all the boxes in the PR template except the one that requires
608579
you to read the instructions.
609-
610580
* Maintaining Your Package
611581
Keeping your project fresh.
612582
** Upgrading ERK
@@ -650,7 +620,6 @@ overview:
650620
By using Nix, your repository can declare a fixed set of dependencies for
651621
development and testing. Not just Elisp dependencies, but also 3rd party
652622
dependencies.
653-
654623
*** Maintaining versions
655624
#+cindex: nix dependency updating
656625

@@ -683,7 +652,6 @@ overview:
683652
version of the flake in the ~nix repl~:
684653

685654
#+begin_src nix
686-
687655
# <nixpkgs> is known in your flake registry
688656
pkgs = import <nixpkgs> { system = builtins.currentSystem; overlays = [ (builtins.getFlake ("emacs-overlay")).overlay ];}
689657

@@ -695,14 +663,12 @@ overview:
695663

696664
# Have fun inspecting the various versions. Checking their declarations in
697665
# emacs-overlay source can be insightful.
698-
699666
#+end_src
700667

701668
To obtain truly specific Emacs versions, specify the Emacs source as a flake
702669
input and then override the attributes of an Emacs package:
703670

704671
#+begin_src nix
705-
706672
inputs = {
707673
# declare the exact source you want
708674
emacs29-src = {
@@ -720,7 +686,6 @@ overview:
720686
});
721687
# It's nix expressions. It's programming.
722688
# Ask your favorite large langauge model!
723-
724689
#+end_src
725690

726691
#+cindex: nix binary cache
@@ -753,17 +718,46 @@ overview:
753718
By changing the versions within the flake to match the versions in question
754719
that are breaking, the user can try versions to confirm a version mismatch and
755720
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)
757751
* Indices
758752
** Command and Function index
759-
:PROPERTIES:
760-
:INDEX: fn
761-
:END:
753+
:PROPERTIES:
754+
:INDEX: fn
755+
:END:
762756

763757
** Concept index
764-
:PROPERTIES:
765-
:INDEX: cp
766-
:END:
758+
:PROPERTIES:
759+
:INDEX: cp
760+
:END:
767761

768762
* Licensing
769763
:PROPERTIES:

lisp/erk.el

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
;; Author: Positron Solutions <contact@positron.solutions>
66
;; Keywords: convenience, programming
7-
;; Version: 0.4.0
7+
;; Version: 0.5.0
88
;; Package-Requires: ((emacs "28.1") (auto-compile "1.2.0") (dash "2.18.0") (license-templates "0.1.3"))
99
;; Homepage: http://github.com/positron-solutions/elisp-repo-kit
1010

@@ -27,23 +27,23 @@
2727

2828
;;; Commentary:
2929

30-
;; Set up Emacs package with GitHub repository configuration, complete with
31-
;; Actions CI, tests, lints, documentation generation, and a licensing scheme
32-
;; all ready to go. Included commands are focused on productivity, appropriate
33-
;; for professional development in elisp. The goal of the package is streamline
34-
;; authoring & distributing new Emacs packages. It provides a well-integrated
35-
;; but rigid scheme, aka opinionated.
30+
;; Set up and develop Emacs packages, complete with Github Actions CI, tests,
31+
;; lints, documentation generation, and a licensing scheme all ready to go.
32+
;; Included commands are focused on productivity, appropriate for professional
33+
;; development in elisp. The goal of the package is streamline authoring &
34+
;; distributing new Emacs packages. It provides a well-integrated but rigid
35+
;; scheme, aka opinionated.
3636
;;
37-
;; The package also uses its own hosted source as a substrate for creating new
38-
;; packages. It will clone its source repository and then perform renaming &
39-
;; re-licensing. Simply call `erk-new' to start a new package. The
40-
;; README documents remaining setup steps on GitHub and in preparation for
41-
;; publishing on MELPA.
37+
;; Simply call `erk-new' to start a new package. ERK will clone a small
38+
;; template project and interactively rename and relicense the project.
39+
;; Instructions on how to host and publish your package are included in the
40+
;; manual.
4241
;;
4342
;; As a development aid, the package is versatile enough to work on some elisp
44-
;; packages that were not descended from its own source. The scope of
45-
;; functionality is primarily to interface with linting and testing frameworks,
46-
;; both in batch and interactive workflows.
43+
;; packages not descended from its templates. The provided functionality
44+
;; focuses on smoothing out typical workflows. Common actions like reloading
45+
;; packages and navigating between source & tests are streamlined. Processes
46+
;; like exporting all documents are automated.
4747

4848
;;; Code:
4949

@@ -149,6 +149,10 @@ you can redistribute it and/or modify
149149
(lambda (f) (format f feature))
150150
files))
151151

152+
;; TODO I mean, it's ideologically good but practically bad. In the lazy case,
153+
;; template authors lose motivation. New package maintainers forget to sign up.
154+
;; Okay, convert this to an optional string replacement and let users decide to
155+
;; be lazy for the greater good.
152156
(defconst erk--delete-files
153157
'(".github/FUNDING.yml")
154158
"Files that would require other accounts to migrate.")
@@ -269,6 +273,8 @@ Only understands project root or root/lisp."
269273
(root-feature-file (car (sort package-files #'string<))))
270274
(concat project-elisp-dir "/" root-feature-file)))
271275

276+
;; Note, these functions are kind of redundant, but just want to consume
277+
;; consistent interfaces internally.
272278
(defun erk-package-author ()
273279
"Return the author of this project's package."
274280
(car (car (lm-authors (erk--project-root-feature-file)))))
@@ -712,7 +718,7 @@ CLONE-ROOT is where the path for the new clone will be created.
712718
713719
REPLACEMENTS is a plist with keys:
714720
715-
- `:full-name': The title of the package, usually found in the
721+
- `:title': The title of the package, usually found in the
716722
README, manual, and the first line of Elisp files.
717723
718724
- `:feature': By convention, all Elisp file names will include

0 commit comments

Comments
 (0)