How davidcarlisle/latexcgi works
Project type and purpose
• This is a full-stack web tool (“latexcgi”) that provides an in-browser LaTeX environment.
• Purpose: serve as a LaTeX server via Perl CGI scripts for learnlatex.org, compiling user-supplied TeX into PDF or HTML (via Make4ht, LaTeXML, Lwarp, etc.) and returning the result through a web interface.
File structure
Top-level directories:
• codemirror6 – front-end source for the in-browser editor (based on CodeMirror 6, Rollup build).
• curl – sample client requests or test harness (e.g., tldnet).
• docs – documentation and example HTML pages showing how to embed/run the editor and renderer.
• latexcgilwarp, latexml, lwarp, make4ht, ngpdf – different back-end modules or engines wrapping various TeX→output toolchains.
• perl – the core CGI scripts (e.g., latexcgi, run1, showtags).
Configuration and support files:
• .gitignore, LICENSE, SECURITY.md
• codemirror6/package.json, rollup config
• make4ht/*.4ht, config and sample .tex tests
• docs/*.js HTML wrappers and test pages
README for additional context
• Confirms “LaTeX server via perl cgi script”
• Hosted at latexcgi.xyz and tied to learnlatex.org
Detailed capture of essential elements
• Fallback or selection logic in the CGI dispatcher
• Rollup build step in codemirror6 before deployment
• Sample data flow: user writes code → editor sends POST → CGI spawns “make4ht” → returns HTML chunk