[Next Project] The Varieties of Religious Experience by William James

76 views
Skip to first unread message

Stephen Fenwick

unread,
Feb 12, 2026, 1:33:15 PM (yesterday) Feb 12
to Standard Ebooks
Now that Privy Seal looks like it's complete I'd like to tackle The Varieties of Religious Experience by William James:

I know this one is significantly longer and more complex.

On the plus side, the PG source is already very well structured with a lot of semantics though in a different format. The endnotes and hyperlinks, for example, can be converted to the Standard Ebooks format with some judicial search-and-replace plus xslt transformations. A similar approach works for foreign language tags. I'll approach this by wherever possible taking the existing semantics and transforming into the Standard Ebooks format rather than starting everything from scratch.

Alex Cabal

unread,
Feb 12, 2026, 2:26:45 PM (yesterday) Feb 12
to standar...@googlegroups.com
OK, this is much, much more complex and lengthy, but if you want to take
it on then let's see. As you noted there are a lot of endnotes. You can
cut the index. There are also many blockquotes in each essay. Since
there is a preface you will have to add a half title page.

Please send a link to your repo once you get started!

On 2/12/26 1:33 PM, Stephen Fenwick wrote:
> Now that Privy Seal looks like it's complete I'd like to tackle The
> Varieties of Religious Experience by William James:
> The Varieties of Religious Experience: A Study in Human Nature by
> William James | Project Gutenberg <https://www.gutenberg.org/ebooks/621>
> Varieties Of Religious Experience. : James,william. : Free Download,
> Borrow, and Streaming : Internet Archive <https://archive.org/details/
> in.ernet.dli.2015.205091/mode/2up>
>
> I know this one is significantly longer and more complex.
>
> On the plus side, the PG source is already very well structured with a
> lot of semantics though in a different format. The endnotes and
> hyperlinks, for example, can be converted to the Standard Ebooks format
> with some judicial search-and-replace plus xslt transformations. A
> similar approach works for foreign language tags. I'll approach this by
> wherever possible taking the existing semantics and transforming into
> the Standard Ebooks format rather than starting everything from scratch.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Standard Ebooks" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to standardebook...@googlegroups.com
> <mailto:standardebook...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> standardebooks/85ea3cb4-b0b8-42e5-9df2-c352ebb06e32n%40googlegroups.com
> <https://groups.google.com/d/msgid/standardebooks/85ea3cb4-
> b0b8-42e5-9df2-c352ebb06e32n%40googlegroups.com?
> utm_medium=email&utm_source=footer>.

Stephen Fenwick

unread,
Feb 12, 2026, 4:33:22 PM (yesterday) Feb 12
to Standard Ebooks
The repo is here: spfenwick/william-james_the-varieties-of-religious-experience

So far I've been focusing on changes that I could script in bulk. That's got
 - endnotes working including backlinks
 - links to specific pages working - there are quite a lot of those in the book
 - foreign language tagging - following the tagging in the source, which I haven't checked yet
 - at least some blockquotes, though I still need to see how much manual formatting is needed.
 - successfully building epub with a working TOC

Now it's a case of going through manually and finding out how much I've taken on 😉. One thing I've noticed is the source doesn't have publication titles tagged, which will be a pain to add.

Alex Cabal

unread,
Feb 12, 2026, 9:43:02 PM (22 hours ago) Feb 12
to standar...@googlegroups.com
OK, Emma will manage with Lukas reviewing.

On 2/12/26 4:33 PM, Stephen Fenwick wrote:
> The repo is here: spfenwick/william-james_the-varieties-of-religious-
> experience <https://github.com/spfenwick/william-james_the-varieties-of-
> religious-experience/>
>
> So far I've been focusing on changes that I could script in bulk. That's got
>  - endnotes working including backlinks
>  - links to specific pages working - there are quite a lot of those in
> the book
>  - foreign language tagging - following the tagging in the source,
> which I haven't checked yet
>  - at least some blockquotes, though I still need to see how much
> manual formatting is needed.
>  - successfully building epub with a working TOC
>
> Now it's a case of going through manually and finding out how much I've
> taken on 😉. One thing I've noticed is the source doesn't have
> publication titles tagged, which will be a pain to add.
> On Friday, February 13, 2026 at 8:26:45 AM UTC+13 Alex Cabal wrote:
>
> OK, this is much, much more complex and lengthy, but if you want to
> take
> it on then let's see. As you noted there are a lot of endnotes. You can
> cut the index. There are also many blockquotes in each essay. Since
> there is a preface you will have to add a half title page.
>
> Please send a link to your repo once you get started!
>
> On 2/12/26 1:33 PM, Stephen Fenwick wrote:
> > Now that Privy Seal looks like it's complete I'd like to tackle The
> > Varieties of Religious Experience by William James:
> > The Varieties of Religious Experience: A Study in Human Nature by
> > William James | Project Gutenberg <https://www.gutenberg.org/
> ebooks/621 <https://www.gutenberg.org/ebooks/621>>
> > Varieties Of Religious Experience. : James,william. : Free Download,
> > Borrow, and Streaming : Internet Archive <https://archive.org/
> details/ <https://archive.org/details/>
> > in.ernet.dli.2015.205091/mode/2up>
> >
> > I know this one is significantly longer and more complex.
> >
> > On the plus side, the PG source is already very well structured
> with a
> > lot of semantics though in a different format. The endnotes and
> > hyperlinks, for example, can be converted to the Standard Ebooks
> format
> > with some judicial search-and-replace plus xslt transformations. A
> > similar approach works for foreign language tags. I'll approach
> this by
> > wherever possible taking the existing semantics and transforming
> into
> > the Standard Ebooks format rather than starting everything from
> scratch.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Standard Ebooks" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to standardebook...@googlegroups.com
> > <mailto:standardebook...@googlegroups.com>.
> > To view this discussion visit https://groups.google.com/d/msgid/
> <https://groups.google.com/d/msgid/>
> > standardebooks/85ea3cb4-b0b8-42e5-9df2-
> c352ebb06e32n%40googlegroups.com <http://40googlegroups.com>
> > <https://groups.google.com/d/msgid/standardebooks/85ea3cb4-
> <https://groups.google.com/d/msgid/standardebooks/85ea3cb4->
> > b0b8-42e5-9df2-c352ebb06e32n%40googlegroups.com
> <http://40googlegroups.com>?
> > utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Standard Ebooks" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to standardebook...@googlegroups.com
> <mailto:standardebook...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> standardebooks/d0a3570a-bab6-48af-b6e7-dca2d434936cn%40googlegroups.com
> <https://groups.google.com/d/msgid/standardebooks/d0a3570a-bab6-48af-
> b6e7-dca2d434936cn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Stephen Fenwick

unread,
Feb 12, 2026, 11:12:32 PM (21 hours ago) Feb 12
to Standard Ebooks
It's nice to e-meet you Emma and Lukas.

The book is coming together well. It's been a lot less effort so far than one might think largely because the source text is so well marked up with semantics, hyperlinks etc. Most of the effort has been figuring out the right scripts to convert to the Standard Ebooks formatting and semantics, with only a bit of manual editing.

The book builds and works well on my ereader, including TOC and endnotes, but lint is giving quite a few errors. A lot of these look reasonable but there are some I'm not sure what to do with.

The first thing I'm grappling with is the text has a round 30 in-text page references (e.g. See p. 123). In the transcription these are conveniently marked up with hyperlinks. I've converted the page break markers to (what I think is) an epub standard format "<span aria-label="127" id="page-127" role="doc-pagebreak"/>" and kept the hyperlinks.


 That's working well in the finished epub, but lint is giving errors for each of the page markers:
   Empty element. Hint: Use <hr/> for thematic breaks if appropriate.
and also
   Unexpected value of id attribute. Found: page-2  Expected: lecture-1-span-1 

My questions are:
 - Is it best to keep the page references as a hyperlink? It does seem to make the book a lot more usable.
 - If I do that then what is the best way to store the location of the page break? Do I need to worry about those lint errors?
 - I'm also getting errors for the unused page markers since at the moment there's a marker for every page and only a few are linked to. I could remove the unused onesbut I'm not sure if that's best - after all epub does allow for representing physical page #s.

Thanks, Stephen

Emma Sweeney

unread,
Feb 12, 2026, 11:48:14 PM (20 hours ago) Feb 12
to Standard Ebooks
Can you make your repo public? The links point to a 404 error page.

Emma

Stephen Fenwick

unread,
1:26 AM (18 hours ago) 1:26 AM
to Standard Ebooks
Sorry, done now.

Emma Sweeney

unread,
3:01 AM (17 hours ago) 3:01 AM
to Standard Ebooks
- Delete the `<span aria-label="#" id="page-#" role="doc-pagebreak"/>` elements throughout the book. You don't need these.
- For each page reference, add an id to the first paragraph in the page. See SEMoS 5.1.2.8 for an example on id formatting.
- In the endnotes, you will need to replace the page references with "see here" or "see this paragraph". Make sure this change is in an editorial commit.


Emma

Stephen Fenwick

unread,
3:53 AM (16 hours ago) 3:53 AM
to Standard Ebooks
Some of the footnotes consist of a reference to another page and nothing else - like this one https://github.com/spfenwick/william-james_the-varieties-of-religious-experience/blob/18b6ee87ca628686f0c8806f350c3751bc2fb795/src/epub/text/endnotes.xhtml#L434

In that situation is it better to delete the footnote and have the original text point to directly to the new location? The text leading up to the footnote reference is "and of which you may recall my relating some examples" so in this case I'd make the word "examples" a hyperlink to the appropriate text on page 152.

Emma Sweeney

unread,
4:42 PM (3 hours ago) 4:42 PM
to Standard Ebooks
You can leave them as endnotes.

Emma

Stephen Fenwick

unread,
6:37 PM (1 hour ago) 6:37 PM
to Standard Ebooks
Could you have a look at the last few commits (from https://github.com/spfenwick/william-james_the-varieties-of-religious-experience/commit/e514d1d1260924e217ee16da894f621315915436 onwards) to check I'm doing this right? I know the id's aren't compliant at the moment - I'm going to clean that up once I've done all the references so I know what the sequence numbers are.
Thanks

Emma Sweeney

unread,
7:25 PM (23 minutes ago) 7:25 PM
to Standard Ebooks
Use  "here" or "this paragraph" instead of "above. Not all ereaders display endnotes at the bottom of the screen.

Emma
Reply all
Reply to author
Forward
0 new messages