-
Notifications
You must be signed in to change notification settings - Fork 174
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
Support personalized templates #258
Conversation
Codecov Report
@@ Coverage Diff @@
## master #258 +/- ##
==========================================
- Coverage 69.02% 67.85% -1.17%
==========================================
Files 22 22
Lines 3693 3771 +78
==========================================
+ Hits 2549 2559 +10
- Misses 900 961 +61
- Partials 244 251 +7
Continue to review full report at Codecov.
|
d797f85
to
c6a3e86
Compare
Added the new functionality and updated the tests and the README. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@folago Thank you for your GREAT COMMIT!!!
I've made two comments, please check them out.
README.md
Outdated
@@ -544,6 +544,9 @@ er: | |||
# ER diagram (png/jpg) font (font name, font file, font path or keyword) | |||
# Default is "" ( system default ) | |||
font: M+ | |||
# ER diagram dot format template, if specified this template file will be used | |||
# in place of the defualt one to generate the dot file for graphviz | |||
# template: schema.dot.tmpl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change to new syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot that commit during rebase, I'll remove it and keep the changes to the README in one place.
@@ -783,6 +786,26 @@ dict: | |||
Table Definition: テーブル定義 | |||
``` | |||
|
|||
### Personalized Templates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
config/config.go
Outdated
@@ -259,6 +261,8 @@ func (c *Config) LoadConfigFile(path string) error { | |||
func (c *Config) LoadConfig(in []byte) error { | |||
err := yaml.Unmarshal(in, c) | |||
if err != nil { | |||
log.Println(err) | |||
log.Println("this should be cool", yaml.FormatError(err, true, true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using yaml.FormatError
is a very good idea. But could you exclude it from this Pull Request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that was a leftover from debug 😁, removing.
By the way, the last version of github.com/goccy/go-yaml has a more informative error message in case of invalid yaml.
Do you mind if I update it in go.mod?
Thanks 🙂
I pushed some fixes to not lose track of what changed, when all is OK I'll rebase so it's cleaner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found one more code that needs to be fixed, but nothing more.
THANK YOU!!! I think you can rebase now.
output/plantuml/plantuml_test.go
Outdated
t.Error(err) | ||
} | ||
// use the templates in the testdata directory | ||
c.Templates.PUML.Table = path.Join(testdataDir(), c.Templates.PUML.Table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you would better use the filepath
package.
c.Templates.PUML.Table = path.Join(testdataDir(), c.Templates.PUML.Table) | |
c.Templates.PUML.Table = filepath.Join(testdataDir(), c.Templates.PUML.Table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will do 🙂
When populated the templates specified in the config file will override the default ones.
Updated README.md with a small paragraph on the personalized templates.
This reverts commit 7d2d73b.
6e3493d
to
2f359ec
Compare
Rebased 🙂 |
YEAAAAAAAAAH!! 🎸 🎸 🎸 🎸 🎸 🎸 🎸 |
I think this is the bare minimum for a PR, If you are willing to Merge I can improve it.
I am aware that this will "force" you to document the template, I am willing to add more docs if needed.