Bogdan-Lyashenko / codecrumbs

Learn, design or document codebase by putting breadcrumbs in source code. Live updates, multi-language support and more.
https://codecrumbs.io
BSD 3-Clause "New" or "Revised" License
2.71k stars 101 forks source link

Golang support #40

Closed shafiev closed 5 years ago

shafiev commented 5 years ago

Hello. Would it be possible to support Golang? i can also provide some support

Bogdan-Lyashenko commented 5 years ago

Hey, sure ;) it’s super simple, I can guide you if you are interested to contribute. Thanks.

shafiev commented 5 years ago

Ok please guide

Bogdan-Lyashenko commented 5 years ago

@shafiev Awesome!

Here is commit for adding fortran support (you can check it as an example). Basically you need to do the next steps: 1) Add go-lang.go file with Hello world code and codecrumb-comment to example-project/languages/ (example) 2) Create src/server/code-parse/language/golang folder with codecrumbs.js and dependencies.js file in it. (examle) 3) In src/server/code-parse/language/golang/codecrumbs.js fix regex, if for Golang single line comment is // (same as for JavaScript) then regex will be /^([^\/\/]*)\/\/(.*)$/ 4) Add mappings for file extensions to src/server/code-parse/language/index.js (example)

To test: 1) In https://github.com/Bogdan-Lyashenko/codecrumbs/blob/master/src/index.dev.js#L3 replace:

Let me know if it helps. Thanks.

idoo commented 5 years ago

@Bogdan-Lyashenko probably we could close it after merge https://github.com/Bogdan-Lyashenko/codecrumbs/pull/69