Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Splitting large text files

Started by Muut Archive 11 years ago · 3 replies · 303 views
11 years ago

Does anyone know a way to split large text files into unique posts for a Grav site?

For instance, I want to use the RTFM template to publish a book, which is divided into chapters, sections, and subsections. I have the book properly formatted as a single text document or HTML file.

Is there a tool to automatically break down the larger document into chapter, sections, and subsections, with the smaller units nested under the larger ones?

I can add the necessary metadata for each would-be Markdown file. I just a way to break down the larger file without having to manually create hundreds of folders, subfolders, and files.

Thank you, — GM

11 years ago

Certainly nothing exists for Grav specifically. However this chunking functionality you are asking about is done for all kinds of reasons on all kinds of platforms.

You could probably find a suitable script to chunk you large HTML files. Either modify this script to automatically add some metadata, or do that after.

http://www.sagehill.net/docbookxsl/Chunking.html

example here.

11 years ago

You might have a look at:
https://github.com/aptly-io/grav-plugin-sectionwidget
It chuncks large markdown into 'sections' only (no sub-sections); I preferred a simple mechanism on top of markdown. It's in github, not in the official gpm catalogue gpm, maintained by rhukster. It was developed against an older version of Grav (and not tested against the latest 0.9.43). Feel free to submit bugs/requests for improvements ...

11 years ago

If you ensure it works with the latest version I would be glad to add it to GPM

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1338 9 years ago
Archive · by Muut Archive, 9 years ago
2 927 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2941 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago