{"id":16912557,"url":"https://github.com/boyter/searchcode-server-highlighter","last_synced_at":"2025-04-11T16:13:51.408Z","repository":{"id":143401218,"uuid":"162191031","full_name":"boyter/searchcode-server-highlighter","owner":"boyter","description":null,"archived":false,"fork":false,"pushed_at":"2019-06-24T07:50:37.000Z","size":459,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T00:56:04.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/boyter.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":"2018-12-17T21:18:08.000Z","updated_at":"2024-06-19T07:51:03.466Z","dependencies_parsed_at":null,"dependency_job_id":"c642846f-8967-4c24-be3d-19f941f871f7","html_url":"https://github.com/boyter/searchcode-server-highlighter","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/boyter%2Fsearchcode-server-highlighter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyter%2Fsearchcode-server-highlighter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyter%2Fsearchcode-server-highlighter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boyter%2Fsearchcode-server-highlighter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boyter","download_url":"https://codeload.github.com/boyter/searchcode-server-highlighter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248438513,"owners_count":21103410,"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":[],"created_at":"2024-10-13T19:10:29.600Z","updated_at":"2025-04-11T16:13:51.384Z","avatar_url":"https://github.com/boyter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"A very simple Go HTTP based Syntax highlighter. Run it, then post some code to the default port and it will return \nCSS + HTML syntax highlighted code.\n\n[![Build Status](https://travis-ci.org/boyter/searchcode-server-highlighter.svg?branch=master)](https://travis-ci.org/boyter/searchcode-server-highlighter)\n[![Scc Count Badge](https://sloc.xyz/github/boyter/searchcode-server-highlighter/)](https://github.com/boyter/searchcode-server-highlighter/)\n\nBuild step to create smallest builds\n\n```\nGOOS=windows GOARCH=amd64 go build -ldflags=\"-s -w\" \u0026\u0026 upx searchcode-server-highlighter.exe \u0026\u0026 mv searchcode-server-highlighter.exe searchcode-server-highlighter-x86_64-pc-windows.exe\nGOOS=linux GOARCH=amd64 go build -ldflags=\"-s -w\" \u0026\u0026 upx searchcode-server-highlighter \u0026\u0026 mv searchcode-server-highlighter searchcode-server-highlighter-x86_64-unknown-linux\nGOOS=darwin GOARCH=amd64 go build -ldflags=\"-s -w\" \u0026\u0026 upx searchcode-server-highlighter \u0026\u0026 mv searchcode-server-highlighter searchcode-server-highlighter-x86_64-apple-darwin\n```\n\nThe resulting build for each file should be ~3 MB\n\n## Sample Usage\n\nInstall [httpie](https://httpie.org/) and [jq](https://stedolan.github.io/jq/), then run the following snippet to generate a local HTML file.\n\n```shell\nFILE=$GOPATH/src/github.com/boyter/searchcode-server-highlighter/main.go\nLANG=go\nSTYLE=tango\n\n# send up the file\nhttp POST localhost:8089/v1/highlight/ languageName=$LANG fileName=$(basename $FILE) style=$STYLE content=@$FILE \u003e res\n\n# munch results\nCSS=$(cat res| jq --raw-output .css  | sed 's/\\\\n/\\n/g')\nHTML=$(cat res| jq --raw-output .html | sed 's/\\\\n/\\n/g')\n\ncat  \u003c\u003c EOF \u003e $(basename $FILE).html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n\u003cstyle\u003e\n$CSS\n\u003c/style\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n$HTML\n\u003c/body\u003e\n\u003c/html\u003e\nEOF\n\necho \"Done: $(basename $FILE).html\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboyter%2Fsearchcode-server-highlighter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboyter%2Fsearchcode-server-highlighter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboyter%2Fsearchcode-server-highlighter/lists"}