Commit Graph

148 Commits

Author SHA1 Message Date
Tom Alexander ef4d315bf2
Run cargo fix. 2023-10-31 20:02:46 -04:00
Tom Alexander 159d8fb72a
Add render stage for text markup. 2023-10-31 20:02:04 -04:00
Tom Alexander 0fae417610
Add intermediate stage for text markup. 2023-10-31 19:57:04 -04:00
Tom Alexander ae933b491e
Use macros for the intermediate to render step.
This is largely to make changing the type signature of these functions easier by significantly reducing the amount of places that duplicates the signature.
2023-10-31 19:48:05 -04:00
Tom Alexander 8695cf17c5
Copy the value of latex fragments through the pipeline. 2023-10-31 19:14:36 -04:00
Tom Alexander ada11816fb
Run cargo fix. 2023-10-29 22:31:29 -04:00
Tom Alexander 0da37b25e3
Assign the reference counts. 2023-10-29 22:29:29 -04:00
Tom Alexander ff03140007
Order the footnotes based on when they start processing rather than when they finish.
This has the benefit of making the output order make sense when footnote definitions reference footnote references but I mostly did it to match the behavior of upstream org-mode.
2023-10-29 22:29:29 -04:00
Tom Alexander 0ae492f8d3
Promote waiting footnote definitions. 2023-10-29 22:29:29 -04:00
Tom Alexander 613d49c6ec
Record on-deck footnote definitions. 2023-10-29 22:29:29 -04:00
Tom Alexander 2e7cfd5637
Only parse footnote definitions if they target a reference that exists. 2023-10-29 22:29:28 -04:00
Tom Alexander afe62de2b6
Re-enable AstNode. 2023-10-29 22:29:28 -04:00
Tom Alexander 1f3b5262b8
Fix build by making the registry guarded by an ArcMutex. 2023-10-29 22:29:28 -04:00
Tom Alexander f63620b547
Registry being mutuably borrowed. 2023-10-29 22:29:28 -04:00
Tom Alexander 671159cb82
Does not work even without IntoAstNode. 2023-10-29 22:29:28 -04:00
Tom Alexander f1e985fb32
Lifetime issue. 2023-10-29 22:29:28 -04:00
Tom Alexander a966be8122
Remove closures from iselector macro. 2023-10-29 22:29:28 -04:00
Tom Alexander 24b9782146
Avoid closures for the intermediate macro. 2023-10-29 22:29:28 -04:00
Tom Alexander 3d44d20384
Running into borrow issue on intermediate. 2023-10-29 18:46:14 -04:00
Tom Alexander f98a09bc59
Use macros for creating the intermediate stage.
This is to make it easier to change function signatures by consolidating the places where the signatures exist.
2023-10-29 18:46:14 -04:00
Tom Alexander 3720558d93
Render the footnote definitions. 2023-10-29 18:46:13 -04:00
Tom Alexander b66ec507ef
Create a render ast node type. 2023-10-29 18:46:13 -04:00
Tom Alexander 645ae26701
Remove intermediate lifetime. 2023-10-29 14:53:11 -04:00
Tom Alexander 6109902945
Create an intermediate ast node type. 2023-10-29 14:45:02 -04:00
Tom Alexander cd27869122
Populate render context for footnote references. 2023-10-29 14:45:02 -04:00
Tom Alexander 795945f0da
Register footnote definitions. 2023-10-29 14:45:02 -04:00
Tom Alexander cb7c28c1ae
Add intermediate lifetime. 2023-10-29 12:24:49 -04:00
Tom Alexander 52ca300de3
Beginning to hand out footnote ids. 2023-10-29 12:24:49 -04:00
Tom Alexander 06dcd22e69
Switch to split inclusive instead of manually-implemented full lines iterator. 2023-10-29 10:59:33 -04:00
Tom Alexander f87c453459
Move the full lines iterator to its own file. 2023-10-29 10:55:03 -04:00
Tom Alexander 6d83828012
Add inline source block. 2023-10-29 10:44:32 -04:00
Tom Alexander fb99fd2b39
Get the source code lines. 2023-10-29 10:32:05 -04:00
Tom Alexander 313313ae53
Initial structure for unhighlighted source blocks. 2023-10-29 09:37:27 -04:00
Tom Alexander d9a3b13780
Use raw_link instead of path for regular links. 2023-10-29 09:31:00 -04:00
Tom Alexander 3d89492518
Add regular link. 2023-10-27 20:43:57 -04:00
Tom Alexander 793789bdf2
Add entity. 2023-10-27 20:27:50 -04:00
Tom Alexander bfc9e3ed80
Add plain list items. 2023-10-27 20:18:19 -04:00
Tom Alexander 62ffc76376
Add basic templates for plain list. 2023-10-27 20:12:56 -04:00
Tom Alexander 5bbb12327b
Add template for quote blocks. 2023-10-27 19:53:18 -04:00
Tom Alexander f6c475c80c
Add templates for text markup. 2023-10-27 19:42:33 -04:00
Tom Alexander c279bad13a
Add children to heading. 2023-10-27 19:22:17 -04:00
Tom Alexander b0ac14ee58
Add the skeletons for the objects. 2023-10-27 17:48:19 -04:00
Tom Alexander 23713a934c
Add the skeletons for the elements. 2023-10-27 17:08:58 -04:00
Tom Alexander 354d24cf69
Add comment as a no-op. 2023-10-27 16:14:37 -04:00
Tom Alexander 5891ac7fb7
Add keyword and as no-op. 2023-10-27 16:09:44 -04:00
Tom Alexander f9377d7609
Make converstion to intermediate state async.
We are going to need to do things like call external tools for syntax highlighting so we are going to need async in there eventually.
2023-10-27 15:55:19 -04:00
Tom Alexander 4a6948cde7
Add paragraph. 2023-10-27 15:46:56 -04:00
Tom Alexander 5b34942b64
Add element. 2023-10-27 15:46:56 -04:00
Tom Alexander 7b01230234
Add target. 2023-10-27 15:05:50 -04:00
Tom Alexander c6cf5f75ac
Introduce a registry into the conversion to intermediate format. 2023-10-27 15:05:49 -04:00
Tom Alexander e3b5f7f74f
Rename blog_post module to intermediate.
This module is mostly the intermediate representation of the AST, so the renaming is to make that more clear. The three forms are parsed => intermediate => render.

Parsed comes from Organic and is a direct translation of the org-mode text.

Intermediate converts the parsed data into owned values and does any calculations that are needed on the data (for example: assigning numbers to footnotes.)

Render takes intermediate and translates it into the format expected by the dust templates. The processing in this step should be minimal since all the logic should be in the intermediate step.
2023-10-27 13:10:21 -04:00
Tom Alexander 1ac39c2a6f
Add RenderPlainText. 2023-10-27 13:01:45 -04:00
Tom Alexander 744d3e50fb
Convert intermediate objects into render objects. 2023-10-27 12:47:12 -04:00
Tom Alexander 4c59011389
Copy heading level. 2023-10-27 12:14:07 -04:00
Tom Alexander ba2756c762
Create intermediate representation for plain text. 2023-10-27 10:23:05 -04:00
Tom Alexander 31a3efe417
Only print the contexts.
This allows us to pipe the output to jq to see the context easier. We can see the rendered output in the files written to disk.
2023-10-24 00:51:28 -04:00
Tom Alexander 2b7a19a1d4
Introduce the corresponding non-render types. 2023-10-24 00:36:08 -04:00
Tom Alexander 3b472a9e96
Introduce element and object enums. 2023-10-24 00:04:44 -04:00
Tom Alexander 77f8375d7a
Introduce an array of document elements. 2023-10-24 00:01:40 -04:00
Tom Alexander 3cfcae25a9
Move the render context to its own folder.
We are going to have a lot of render context types because there are so many org-mode elements/objects so I'm moving it to a separate folder for organization.
2023-10-23 23:49:35 -04:00
Tom Alexander ab36a60545
Generate the minimum relative path by chopping off the shared stem. 2023-10-23 23:04:05 -04:00
Tom Alexander 68cae57f16
Add a function to get the shared portion of a path. 2023-10-23 22:50:43 -04:00
Tom Alexander 11bfb6836f
Include a self-link for the blog. 2023-10-23 22:38:00 -04:00
Tom Alexander 3ac7826d2c
Move the logic into convert_blog_post_page_to_render_context.
I was writing it in the build command's rust files for convenience, but now its getting long enough to warrant moving it into its final location.
2023-10-23 22:10:26 -04:00
Tom Alexander 178ce877bc
Render the head for the page. 2023-10-23 21:51:15 -04:00
Tom Alexander 2b6f86d4e9
Switch to rendering blog post pages instead of blog posts. 2023-10-23 20:30:43 -04:00
Tom Alexander dc233d26b1
Store the title in BlogPostPage. 2023-10-23 18:39:54 -04:00
Tom Alexander e543a5db74
Starting to introduce a BlogPostPage struct.
Blog posts are going to be constructed of multiple documents each forming their own page. This will allow me to link to supporting documents without having to promote them to their own pages.
2023-10-23 16:03:37 -04:00
Tom Alexander 199621b6f1
Remove the separation of the main template.
I don't think this is necessary, and it certainly isn't necessary at this level.
2023-10-22 18:39:05 -04:00
Tom Alexander 586fd8a066
Getting rendered output from duster. 2023-10-22 18:31:56 -04:00
Tom Alexander 043cc5eda4
I think I have worked around the lifetime issue by keeping references to the intermediate str's. 2023-10-22 18:12:45 -04:00
Tom Alexander 58aba8efd5
Invoking the compile function.
I am going to have to address the lifetime issue of "compiled" duster templates borrowing the input str.
2023-10-22 17:37:27 -04:00
Tom Alexander ce0819e85b
Feeding the templates into the renderer integration. 2023-10-22 17:31:12 -04:00
Tom Alexander fc5342adce
Make the renderer a bit more generic. 2023-10-22 16:40:58 -04:00
Tom Alexander 24bac982f1
Starting to create the renderer integrations.
These are the layer directly over dust which can be used by anything, not just blog posts.
2023-10-22 16:26:43 -04:00
Tom Alexander 5f34cb2dd5
Creating a SiteRenderer struct to handle the logic for invoking dust. 2023-10-22 16:10:41 -04:00
Tom Alexander 0b6900eeca
Serialize the RenderBlogPost to JSON.
This struct still does not contain anything, but I'm just setting up the skeleton for this code.
2023-10-22 16:01:42 -04:00
Tom Alexander b72aec9d20
Starting a struct for what will be passed as the context into dust. 2023-10-22 15:31:45 -04:00
Tom Alexander a0c5b2d852
Don't use walkdir for getting the post directories.
We are only iterating a single level of depth anyway, so read_dir is enough.
2023-10-22 14:49:08 -04:00
Tom Alexander a9fbb4cd63
Get the output directory and clear it. 2023-10-22 14:40:59 -04:00
Tom Alexander 07e4209048
Setting the post id based on the folder name. 2023-10-22 13:50:11 -04:00
Tom Alexander 2f0f3ab346
Switch to using CustomError because a boxed StdError is not Send. 2023-10-22 13:44:03 -04:00
Tom Alexander d8fc49797e
Moving into a load_blog_post function to create a BlogPost struct. 2023-10-22 12:04:09 -04:00
Tom Alexander 816780589f
Parse the org-mode files. 2023-10-21 18:00:51 -04:00
Tom Alexander acaa12cb6e
Read the org files inside the writer directory. 2023-10-20 20:16:22 -04:00
Tom Alexander 051e86e65a
Remove the AddPost command.
I will be putting this back in later but having the skeleton sitting there unused has no value at this time.
2023-10-20 19:13:22 -04:00
Tom Alexander 273734c9ff
Switch to storing a path to the config file instead of a path to the root directory. 2023-10-20 18:46:22 -04:00
Tom Alexander 4314937d26
Add a function to load a config from file. 2023-10-20 18:39:26 -04:00
Tom Alexander 672ca07a0e
Introduce a new config struct the lives above the raw disk implementation.
This should let us include values that would not be written to disk like the folder containing the config.
2023-10-18 21:25:37 -04:00
Tom Alexander 2350390148
Add some settings to the config. 2023-10-18 20:30:32 -04:00
Tom Alexander 933387eb6f
Writing the writer.toml to a folder when running init. 2023-10-18 20:21:28 -04:00
Tom Alexander 5f82d7a469
Add serde and toml for parsing the config. 2023-10-18 20:06:30 -04:00
Tom Alexander 63b0619094
Add the folder structure for the toml config. 2023-10-18 20:00:39 -04:00
Tom Alexander 8b5930f277
Set up folder structure for the command handlers. 2023-10-18 19:54:18 -04:00
Tom Alexander 179b07388a
Add a test for verifying the clap CLI. 2023-10-18 19:49:03 -04:00
Tom Alexander a1f4600483
Move the CLI to a module. 2023-10-18 19:47:05 -04:00
Tom Alexander 1b189cf15c
Add very basic CLI. 2023-10-18 19:36:15 -04:00
Tom Alexander 1ca2d2f49d
Initial commit. 2023-10-18 19:03:45 -04:00