Giter Site home page Giter Site logo

Comments (6)

tierpod avatar tierpod commented on June 16, 2024

@morrowc Thank you for your idea and PR! Sorry for late answer.

I see that searching templates in current working directory is a bad idea.

Your way has many advantages for end user:

  • it's much more reliable
  • it's easier to install, you don't have to prepare templates directory

And one disadvantage:

  • It's harder to change templates, you have to recompile binary for that (although I haven't changed templates for a long time, I think it is convenient feature to use for development at least).

Maybe we can keep your changes and add another output format for using external template file? What do you think? Something like this:

output:
  format: "external_template"
  external_template: "/path/to/file.gotmpl"

from dmarc-report-converter.

morrowc avatar morrowc commented on June 16, 2024

howdy! no worries on the delays...

I think there are 2 things going on:

  1. an assumption about directory for deployment/runtime
  2. a normal form/style change to include the template content at compile time instead of rationalizing how to do 1 better.

You mention: "easier for development", which seems specious to me, since unless you included a ton of random/extra data in the template data struct, you'd always have to reompile to get data included and output that in the template(s) output?
(unless you mean just changing the free-text... which seems like a fairly light load of trade-off to me).

from dmarc-report-converter.

tierpod avatar tierpod commented on June 16, 2024

unless you mean just changing the free-text

Yes, I meant this. For me, data struct is almost static and isn't changed a lot. But html or txt templates can be changed a lot during development process or even in production usage. I don't know, maybe someone already uses self-written custom templates. That's why I would like to keep ability to use external template via another output format.

Anyway, your PR is good, I'm going to merge it soon.

from dmarc-report-converter.

morrowc avatar morrowc commented on June 16, 2024

ah! ok, I see your usecase now. If you merge this and send me an issue I'll put in a pr that we can discuss?

from dmarc-report-converter.

tierpod avatar tierpod commented on June 16, 2024

I merged your PR and added external_template output format. Thanks!

from dmarc-report-converter.

tierpod avatar tierpod commented on June 16, 2024

New version v0.6 was released

from dmarc-report-converter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.