Skip to content

Added transform command. - #29

Merged
bwplotka merged 13 commits into
mainfrom
web
May 19, 2021
Merged

bwplotka merged 13 commits into
mainfrom
web

Conversation

@bwplotka

Copy link
Copy Markdown
Owner

Signed-off-by: Bartlomiej Plotka bwplotka@gmail.com

bwplotka added 2 commits May 17, 2021 01:52
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
@bwplotka bwplotka changed the title Added web command. Added fmt command. May 17, 2021
@bwplotka bwplotka changed the title Added fmt command. Added transform command. May 17, 2021
@bwplotka
bwplotka force-pushed the web branch 2 times, most recently from d75d455 to f6f1466 Compare May 18, 2021 08:24
@bwplotka
bwplotka marked this pull request as ready for review May 18, 2021 11:07
@saswatamcode
saswatamcode self-requested a review May 18, 2021 11:43
@bwplotka
bwplotka force-pushed the web branch 2 times, most recently from 4451b28 to 6660100 Compare May 18, 2021 16:50
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
@bwplotka

Copy link
Copy Markdown
Owner Author

PTAL @saswatamcode (:

bwplotka added 4 commits May 18, 2021 19:15
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
bwplotka added 4 commits May 18, 2021 20:01
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

@saswatamcode saswatamcode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks really amazing✨! Just some suggestions.

Comment thread README.md Resolved
Comment thread main.go
// the same?
func registerTransform(_ context.Context, app *extkingpin.App) {
cmd := app.Command("transform", "Transform markdown files in various ways. For example pre process markdown files to allow it for use for popular static HTML websites based on markdown source code and front matter options.")
cfg := cmd.Flag("config", "Path to the YAML file with spec defined in github.com/bwplotka/mdox/pkg/transform.Config").

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe a section can be added to README about transform command, with sample config yaml, and that can be linked instead of struct? 🙂

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Well, we could use mdox-exec with our tool we plan to build and do this at the point? =D Great idea!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sure!

Comment thread pkg/transform/transform.go Resolved
Comment thread pkg/transform/transform.go Resolved
defer errcapture.Close(&err, file, "close file")

scanner := bufio.NewScanner(file)
for scanner.Scan() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we check scanner.Err() after this loop?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Very good point, I missed this.

Where did you learn so many stuff about golang already??? ;p

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Done

bwplotka and others added 2 commits May 19, 2021 13:57
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: Saswata Mukherjee <saswataminsta@yahoo.com>
@bwplotka
bwplotka merged commit b9ce917 into main May 19, 2021
@bwplotka
bwplotka deleted the web branch May 19, 2021 13:04
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

⌂ 换网址