{"id":18267507,"url":"https://github.com/anonymerniklasistanonym/marktex","last_synced_at":"2026-04-11T01:03:09.169Z","repository":{"id":37869951,"uuid":"239987764","full_name":"AnonymerNiklasistanonym/MarkTeX","owner":"AnonymerNiklasistanonym","description":"Webserver for viewing, editing and exporting of Markdown files with LaTeX sections","archived":false,"fork":false,"pushed_at":"2023-02-11T10:50:03.000Z","size":3080,"stargazers_count":1,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T20:56:58.601Z","etag":null,"topics":["docker","express","inkscape","latex","markdown","markdown-it","mocha-chai","nodejs","pandoc","socket-io","sqlite3","typescript","webpack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnonymerNiklasistanonym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-12T10:40:58.000Z","updated_at":"2022-08-14T20:33:38.000Z","dependencies_parsed_at":"2023-02-13T10:30:54.494Z","dependency_job_id":null,"html_url":"https://github.com/AnonymerNiklasistanonym/MarkTeX","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnonymerNiklasistanonym%2FMarkTeX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnonymerNiklasistanonym%2FMarkTeX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnonymerNiklasistanonym%2FMarkTeX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnonymerNiklasistanonym%2FMarkTeX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnonymerNiklasistanonym","download_url":"https://codeload.github.com/AnonymerNiklasistanonym/MarkTeX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247964365,"owners_count":21025185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","express","inkscape","latex","markdown","markdown-it","mocha-chai","nodejs","pandoc","socket-io","sqlite3","typescript","webpack"],"created_at":"2024-11-05T11:27:42.409Z","updated_at":"2026-04-11T01:03:09.127Z","avatar_url":"https://github.com/AnonymerNiklasistanonym.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MarkTeX\n\nWebapp for Markdown notes and summaries with LaTeX math and `tikzpicture`s that can be publicly shared or be private.\n\n## What problem does it solve\n\n- Write notes, homework, summaries alone and together uncomplicated in Markdown syntax\n- Insert complicated (`tikzpicture`) graphs and images based on existing `pandoc` integrations\n- Easily collect/group notes and documents and thus find them quickly\n- Export the documents for offline rendering to PDF using `pandoc` and a `Makefile`\n\n## Current development state\n\nBasic backend and frontend is ready (debug logs, routing, database integration, markdown rendering, pdf/source export).\nSome tests were added for backend and server routes.\n\nThe current (next) features that are being developed are:\n\n- [ ] Check if permission system (friends, public, access entries) is working\n- [ ] Add option to integrate additional document resources (like pdf, svg, png images)\n- [ ] Optimize client side markdown rendering and pandoc options to have output that looks the same (pandoc image size for markdown images)\n- [ ] Implement socket collaboration test editor (the base is there but a good logic/merge algorithm is missing right now)\n- [ ] Add custom LaTeX templates to give the user even more options like footer/header and custom styles when converting to PDF\n\n## Requirements\n\n(*it could be that later versions are required, but the tested versions are guaranteed to work*)\n\n| Program | Version required | Version tested |\n| ------- | ---------------- | -------------- |\n| `npm` | | 6.14.7 |\n| `nodejs` | 13.9+ | 14.7.0 |\n| `pandoc` | 2.9+ | 2.9.2.1 |\n| `xetex` (`texlive-full`)  | | 0.999992 |\n| `inkscape` | 1.0+ | 1.0 |\n\nPossible other requirements could be:\n\n- `python`, `make`: For building `sqlite3` with `npm` from source\n\n### Tested on\n\n- Linux [5.7.12-1-MANJARO] (x64)\n- Linux [raspberrypi 4.19.66-v7+] (armv7l) *very slow*\n- Windows [10.0.18363] (x64)\n\nThere is a [Pacman AUR package](https://aur.archlinux.org/packages/marktex/).\n\n## Quickstart\n\n- Server side entry point: `src/index.ts` (source files are in `src` without the directory `src/public/`)\n  - Compiled to JavaScript via `ts-node` (`dist/index.js`)\n- Client side entry point: `src/public/scripts/index.ts` (source files are in `src/public/scripts`)\n  - Compiled to JavaScript file via `webpack` (`dist/public/scripts/bundle.js`)\n\nThe server port can be configured by coping the file `.env.sample` to `.env` and customizing it.\n\n---\n\nInstall all dependencies:\n\n```sh\nnpm install\n```\n\n### Development\n\nTo see the debug output through the internal node util package run in the terminal:\n\n```sh\nexport NODE_DEBUG=app*\n# Executing the following command automatically does that for you\nnpm run dev\n```\n\nThe following command automatically updates the server when you change something or you can do it manually by entering `rs` + `ENTER`:\n\n```sh\nnpm run dev:watch\n```\n\n#### Custom types\n\nBecause currently the custom types are not correctly recognized via VSCode intellisense (but they are from the TypeScript compiler) you need to run a command to copy them to the `node_modules/@types` directory:\n\n```sh\nnpm run vscodeTypeIntegration\n```\n\n#### Debug\n\n- Nodejs server debugging works with VisualStudioCode (Insiders) when opening the repository as root directory\n- Frontend debugging works with Mozilla Firefox (Nightly) but seemingly not out of the box in other browsers like Chromium\n\n### Production\n\nThe following command builds all files into the directory `dist`:\n\n```sh\nnpm run build\n```\n\nThen optionally the `node_modules` directory can be removed and you can run `npm install --only=prod`.\nThen the built files can be run with only a small amount of dependencies (for example on a web server):\n\n```sh\n# rm -rf node_modules\n# npm install --only=prod\nnpm run start\n```\n\n## Sources\n\n- https://developer.okta.com/blog/2018/11/15/node-express-typescript\n- https://webpack.js.org/concepts/\n\n## Node Commands\n\nRun commands via `npm run COMMAND_PLACEHOLDER`.\n\nThe built files can be found in the `dist` directory and the entry point is called `index.js`.\n\n| Command |  Description |\n| ------- | ------------ |\n| `build` | Build the application |\n| `start` | Run the built application (requires a one time execution of `build`) |\n\n| Command |  Description |\n| ------- | ------------ |\n| `clean` | Remove all temporary files created by running `build`, `docs` and `copy:assets` |\n| `copy:assets` | Copy any external server resources to the `dist` directory (views, style sheets, ...) |\n| `dev` | Build the application and then run it (with debug features for development) |\n| `dev:watch` | Run the application and restart it automatically if source code is updated |\n| `docs` | Create source code documentation in `docs/site` |\n| `lint` | Lint Typescript files for errors and code style (auto fixes all auto fixable problems) |\n\n## Dependencies\n\n| Package | Description |\n| --- | ------ |\n| `archiver` | Create file archives |\n| `body-parser` | Parse HTML forms |\n| `compression` | Serve files compressed |\n| `dotenv` | Read bash environment variables from an `.env` file |\n| `express` | Server |\n| `express-handlebars` | Render websites from handlebars templates |\n| `express-session` | Connect website interactions to one session from one user |\n| `express-validator` | Validate and sanitize server requests |\n| `github-markdown-css` | GitHub like rendering for plain markdown elements |\n| `handlebars` | Render websites from handlebars templates |\n| `highlight.js` | Frontend rendering of code sections |\n| `http-errors` | Generate http errors |\n| `js-yaml` | Parse and create YAML files |\n| `katex` | Frontend rendering of LaTeX math |\n| `markdown-it` | Frontend rendering of Markdown text |\n| `socket.io` | Websocket implementation for server backend |\n| `socket.io-client` | Websocket implementation for client frontend |\n| `spdy` | Http2 server for backend |\n| `sqlite3` | Database integration for server backend |\n\n### DevDependencies\n\nThese dependencies are not necessary to run this service but to build it or for example run tests.\n\n| Module | Description |\n| ------ | ----------- |\n| `@types*` | Types for Typescript code for more type security and ease of use (when using an IDE like VSCode) |\n| `chai` | Write test cases |\n| `compression-webpack-plugin` | Compress webpack created JavaScript files |\n| `cross-env` | Set environment variables cross platform in `npm run` commands |\n| `eslint`, `eslint-plugin*` | Lint code for errors and code style |\n| `glob` | Get all files given a regex and directory |\n| `leasot` | Find TODOs in files of different types |\n| `mocha` | Perform and create tests |\n| `nodemon` | Nodemon watches files for changes and automatically restarts the Node.js application when changes are detected which is useful during the development |\n| `npm-run-all` | Use to execute multiple npm scripts sequentially or in parallel (only used in `package.json`)  |\n| `nyc` | Calculate and inspect test coverage |\n| `open` | Open files with their default application |\n| `shelljs` | Use to execute shell commands such as to copy files and remove directories |\n| `ts-node` | Run TypeScript files directly (otherwise they must first be compiled to JavaScript files) |\n| `typedoc` | Create HTML documentation of TypeScript files |\n| `webpack`, `webpack-cli` | Bundle node modules (and compile TypeScript files) for client side JavaScript usage |\n\n## Docker\n\nRun and build this project via docker with: (`sudo`) `make`\n\nThe container accesses per default the database in the local directory `~/.marktex`.\n\n### Start/Stop docker service after installation\n\nWhen you get an error like `Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?`,you can try the following command to start the docker daemon:\n\n```sh\n# Start docker daemon (if there is still an error try restarting your system)\nsudo systemctl start docker\n# Stop docker daemon\nsudo systemctl stop docker\n```\n\n### Stop running container\n\n```sh\n# Get docker container id\nsudo docker ps\n# Stop running docker container\nsudo docker stop CONTAINER_ID\n```\n\n### Info about container\n\n| Command |  Description |\n| ------- | ------------ |\n| (`sudo`) `docker ps` | Get the container ID and port |\n| (`sudo`) `docker inspect \u003cCONTAINER_ID\u003e` | Get IP address (`grep IPAddress`) and other information of docker machine |\n\nYou can also access the website directly from the container via the IP address from `docker inspect \u003cCONTAINER_ID\u003e | grep IPAddress` and the original port (`8080`) [instead of `localhost:8080/xyz` visit `DOCKER_CONTAINER_IP_ADDRESS:8080/xyz`].\n\n### Clean **ALL** docker files\n\nThis gives you like 10GB or more free space but also **removes project unrelated docker files!**\n\n```sh\n# Remove all docker containers and images\nsudo docker container prune -f\nsudo docker image prune -af\n```\n\n## Http2\n\nThe server runs per default via Http1 but if the script [`create_ssl_certificate.sh`](create_ssl_certificate.sh) is run or the files `ssl.crt` and `ssl.key` can be found in the directory `keys` it automatically switches to the Http2 protocol.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonymerniklasistanonym%2Fmarktex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanonymerniklasistanonym%2Fmarktex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanonymerniklasistanonym%2Fmarktex/lists"}