Skip to content

epubknowledge/linker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Linker

A handy way to create many links across multiple HTML files

Usage:

  1. Create a tab-delimited text file in the following format:
     file-to-link-from\ttext to link from\tfile-to-link-to\t<html>to link to\n

example:

     POSBActSpa02_chapter02.xhtml	I. Los grandes días de expectación	POSBActSpa02_chapter03.xhtml	<h1><span class="label">División I</span>Los Grandes Días de Expectación
  1. Save the file in your EPUBs 'META-INF' folder in UTF-8 format with Unix line breaks (\n)
  2. Install Linker globally after cloning the repo by entering npm install -g from within the linker directory
  3. Navigate in a terminal to your EPUB directory
  4. Run linker file.txt 1 where 'file.txt' is the file you created in META-INF and '1' is the number you want to start with for incrementing ids

Behavior:

  • Linker will surround the first occurrence of 'text to link from' in 'file-to-link-from' with an <a> tag whose href is file-to-link-to with a unique id: #ref[num] e.g. <a href="POSBActSpa02_chapter03.xhtml#ref1">I. Los grandes días de expectación</a> This could give you less than satisfactory results if there are multiple occurrences of 'text to link from' in 'file-to-link-from'

  • Linker will add an id to the first HTML element of the first occurrence of 'to link to' in 'file-to-link-to' e.g. <h1 id="ref1"><span class="label">División I</span>Los Grandes Días de Expectación Again, if there are multiple occurrences of 'to link to' Linker will always tag the first exact match

-Peter Turner

About

Node.js console app to create many links across multiple HTML files rapidly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%