Comments (3)
Hello, thank you for the report.
Could you please explain this use case more detailed? IIRC, I haven't exported this variable for external template on purpose. I assume, if you use external_template (and you write this template) you can hardcode necessary assets path in this template.
from dmarc-report-converter.
First, I've been looking for a simple tool like dmarc-report-converter
that doesn't require a bunch of resources and infrastructure (preferably written in Go). I've setup an AWS SES sub-domain to deliver reports to an S3 bucket, which I pull down before running dmarc-report-converter
. It's working great so far, so thank you for all of the hard work you've put into this project before I showed up complaining about things. 😆
My use case started with wanting to hack on the default template (htmlTmpl
from consts.go
). I copied the contents to a separate file and ran it. Right out of the gate, I got errors and had to define my own template variable and rewrite all references of .AssetsPath
to $AssetsPath
. This is when I opened this issue (in haste!).
But then I quickly realized that the default contexts are completely different. The external template's default context is just the pkg/dmarc.Report
struct. So, I had to rewrite all of that, too (something like s/({{\s*\.)Report./$1/g
).
I find all of that an annoying learning curve and a barrier to entry for newcomers (like me). I don't see the harm in exporting AssetsPath
. If the user doesn't want to use it, they don't have to. IMHO, it would be more intuitive to have the same contexts in each template so that I could use the built-in templates as a guide.
Potential Fix
A potential backward-compatible fix could be something like:
type TmplCtx struct {
AssetsPath string
Report dmarc.Report
// Deprecate these properties
XMLName xml.Name
ReportMetadata dmarc.ReportMetadata
PolicyPublished dmarc.PolicyPublished
Records []dmarc.Record
MessagesStats dmarc.MessagesStats
}
from dmarc-report-converter.
Thank you for explanation.
I understand your use case and it's completely valid. I agree that it would be better for new users to have consistent variables across all kind of templates (didn't think about it when I implemented external template).
from dmarc-report-converter.
Related Issues (20)
- XML syntax error HOT 12
- Date field request HOT 2
- imap: can't read next part: unhandled charset "utf-ascii" HOT 2
- Now option not working HOT 2
- option to output logs to stderr instead of stdout HOT 2
- Configuration on nginx not working HOT 2
- Most dmarc reports from Comcast cannot be read HOT 6
- ReadParseGZIP: unsupported MimeTypeGZIP HOT 1
- Unable to deploy HOT 2
- Error without outputting json file when report contains empty record HOT 3
- Play with pico css
- Improve UX of browsing through reports HOT 4
- Support importing .pst files HOT 2
- incorrect parsing Auth results DKIM HOT 1
- Enable GitHub workflow on pull requests HOT 1
- Ignore eml files when processing extracted reports
- Messages with inline MIME headers are not processed HOT 2
- Created a Docker Compose wrapper HOT 2
- Packaged it for Nix HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dmarc-report-converter.