aslushnikov / latex-online

Online latex compiler. You give it a link, it gives you PDF
http://latexonline.cc
MIT License
491 stars 89 forks source link

Can there be an option to compile the file freshly each time it is loaded? #71

Open niruvt opened 3 years ago

niruvt commented 3 years ago

I created a sample project at https://github.com/NiranjanTambe/latexonline.cc

I committed a file and formed a build URL from the latexonline.cc

Then I added another commit and changed one word from the file. i.e. second in place of first on the 8th line of the code and 3rd line of the output.

What I expect is if I send the build URL in a mail and someone opens it ten years later, the output should show the output that is considered to be latest at that time. If not by default at least with an option like &freshcompile in the URL itself. So that it would be compiled again freshly. (Personally I don't consider this ideal, but still...) Is it possible to provide such a mechanism?

Right now even if I provide the URL of a file from a specific commit it doesn't show me the output of the code at that point of time in the commit-history. e.g. https://github.com/NiranjanTambe/latexonline.cc/blob/c13b957f1d2490da57144f4b455de5e5c6032c5b/test.tex is the address for the test-file at the point of second commit. If I generate a build URL for this address I don't get the commit part of it in the output URL. The URL produced by the site currently is still the same as the earlier one.

Ideally the normal URL (without any specific reference to a commit) should always freshly compile the file every time the URL is loaded. This might slow-down the process a bit, but it would be more transparent IMO.

There should also be an option to compile files from a specific time in the commit-history. Suppose a particular file is absent in the latest version of the project; but at some point of time it was there, loading the URL from the commit-history is the only option available and in the given mechanism it seems to be impossible.

harieamjari commented 3 years ago

Can't you use https://latexonline.cc/compile?url=https://raw.githubusercontent.com/niruvt/latexonline.cc/main/test.tex

Souptik2001 commented 2 years ago

Just add the parameter &force=true, this will force cache skipping and document recompilation.