Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add templating syntax and support for the .uor file extension #3

Merged
merged 6 commits into from
May 24, 2022

Conversation

afflom
Copy link

@afflom afflom commented May 10, 2022

Adds support for UOR templating syntax and the .uor file extension. If a file has the .uor extension, ignore the mediatype and look for templating syntax.

Templating syntax is prefixed with __uor. and suffixed with __. i.e. __uor.path/to/file.jpeg__

@afflom afflom force-pushed the feat/add-uor-support branch 2 times, most recently from 85fa98b to db3eb07 Compare May 17, 2022 06:22
@afflom afflom changed the title [WIP] Add templating syntax and support for the .uor file extension Add templating syntax and support for the .uor file extension May 23, 2022
Copy link
Contributor

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple nits. Overall looks good.

return nil
}

// mergeLinkData will merge any references to in-content links with
// the currently calculated values.
func mergeLinkData(in, curr map[string]interface{}) map[string]interface{} {
for key := range in {
//fmtVal := parser.ConvertFilenameForGoTemplateValue(in[key].(string))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment?

@@ -36,6 +36,11 @@ func (e *ErrInvalidFormat) Error() string {
// ByContentType returns a parser based on the detected content type.
func ByContentType(filename string, data []byte) (Parser, error) {
mType := mimetype.Detect(data)
// The .uor extension queues the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment might be unfinished.

Copy link
Contributor

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Ignoring the linting failure for Windows for now as it is unrelated to this pull request. I will submit a subsequent PR to fix it.

Update
PR submitted for Windows fix #15

@jpower432 jpower432 merged commit f24b1f5 into ortelius:main May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants