Stack Overflow community.
Introduction: I’m a technical writer working with DITA XML and using it to publish to HTML. I keep my DITA XML in Git on GitHub, and manually use a workflow in GitHub to publish the resulting HTML to an Azure static web page.
The problem: I want to track changes in the source code (.dita files) but not the output code (.html files). The HTML files are all in a subdirectory (/docs) but I cannot just add docs/ to .gitignore because the HTML files are then processed by the GitHub workflow to actually publish the page.
Is there any way to go around this? I found ways to ignore the subdirectory, to assume that it has not been changed, but in all such circumstances my commit would not include the resulting HTML and it would not be pushed to GitHub, and therefore I would not be able to publish the page.
My colleagues suggested that I move the transformation process (.dita to .html) to GitHub and include it in the workflow, but that is not possible, the transformation must be done on my machine due to the specifics of the software I use (it’s based on DITA-OT but extends it and without those extentions, the styling of the resultant HTML would be off).
Any suggestions would be appreciated. It’s not critical, just a nuisance, since each commit has around 400 files changed, while I may have just changed one small thing in one .dita file but had to rerun the transformation from scratch (and the transformation uses random IDs in HTML, so each resulting HTML batch is different).
Tried .gitignore, tried assume-unchanged, neither one of them seem to fit this. Found several threads on stackoverflow but they all apply to situations where the ignored content does not need to be available at the remote.
Note: my knowledge of git is very limited and I prefer to use the SourceTree GUI to manage it. Dammit, Jim, I’m a technical writer, not a developer! 😀
Tomasz Andrzej Nidecki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.