diff --git a/README.md b/README.md index 9eb456b..ada3fb6 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ A web app and CLI tool to generate beautiful LaTeX resume using available open s https://cv-generator-40m5.onrender.com ## Available templates -* A slightly modified [AltaCV](https://github.com/liantze/AltaCV). The original altacv latex class was written by LianTze Lim (liantze@gmail.com). + +- A slightly modified [AltaCV](https://github.com/liantze/AltaCV). The original altacv latex class was written by LianTze Lim (liantze@gmail.com). ### Template Modifications @@ -32,7 +33,7 @@ cv-generator serve Optional flags: -- `--port [PORT]`: specify port to run, default at `8080` +- `--port [PORT]`: specify port to run, default at `8170` ### Run as CLI app @@ -46,13 +47,13 @@ Optional flags: ## Installation -### Docker (web app) +### Docker Make sure to install Docker in your system 1. Navigate to the project roots directory, and build the Docker image `docker build -t [TAG_NAME] .` -2. Run the image and bind the port, i.e. on port 8080 `docker run -p 8080:8080 [TAG_NAME]` -3. Navigate to `localhost:8080` or any other ports that defined in the previous step +2. Run the image and bind the port, i.e. on port 8080 `docker run -p 8170:8170 [TAG_NAME]` +3. Navigate to `localhost:8170` or any other ports that defined in the previous step ### Local Installation diff --git a/cmd/serve.go b/cmd/serve.go index f1ed9db..629c283 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -26,7 +26,7 @@ func serveHttpServer(port string) { mux.HandleFunc("/api/v1/generate", handlers.GenerateFileHandler) mux.HandleFunc("/api/v1/example", handlers.ExampleFileHandler) if port == "" { - port = "8080" + port = "8170" log.Printf("defaulting to port %s", port) } if err := http.ListenAndServe(":"+port, mux); err != nil { diff --git a/frontend/package.json b/frontend/package.json index d5e03b5..0af5226 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -40,7 +40,7 @@ "build": "react-app-rewired build", "test": "react-scripts test --env=jsdom" }, - "proxy": "http://localhost:8080", + "proxy": "http://localhost:8170", "eslintConfig": { "extends": [ "react-app", diff --git a/pkg/generator/latex.go b/pkg/generator/latex.go index 8430731..888ee04 100644 --- a/pkg/generator/latex.go +++ b/pkg/generator/latex.go @@ -7,7 +7,17 @@ import ( ) func replaceUnescapedChar(str string) string { - return strings.ReplaceAll(str, "_", "{\\_}") + s := strings.NewReplacer( + "_", "{\\_}", + "#", "{\\#}", + "%", "{\\%}", + "&", "{\\&}", + "$", "{\\$}", + "{", "{\\{}", + "}", "{\\}}", + ) + + return s.Replace(str) } func createLatexFile(fg FileGenerator) error {