Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update languages.json: MDX Support #445

Merged
merged 5 commits into from
Apr 10, 2024
Merged

Conversation

sgoggins
Copy link
Contributor

I believe mdx files will be supported by adding the extension to the markdown block. The syntax is markdown.

I believe mdx files will be supported by adding the extension to the markdown block. The syntax *is* markdown.
@sgoggins
Copy link
Contributor Author

@boyter : I tried to get this to catch the .mdx files in a repository by making these changes. I perhaps did not compile correctly? go build ? Or, other files need to be changed. The syntax for these .mdx files does look like markdown.

@sgoggins
Copy link
Contributor Author

This fixes issue #439

@sgoggins
Copy link
Contributor Author

Out of morbid curiosity as a newcomer to go, I'm curious why go build doesn't make the changes work. This series of steps, which I'm sure a real GO programmer would know, worked for me. FWIW:

 go mod tidy
 go generate ./...
 go build -a
 ./scc -l  #a test 

@boyter
Copy link
Owner

boyter commented Apr 10, 2024

Its the go generate part that does it. It actually triggers this https://github.com/boyter/scc/blob/master/main.go#L14C1-L14C40 which in turn calls https://github.com/boyter/scc/blob/master/scripts/include.go which does some validation and produces embedded content.

Its common practice in Go to generate code since dynamic stuff can be a pain.

It is possible to do this via a build these days using embed however it wouldn't do the pre-checks to ensure the JSON is valid, although would be picked up later on. Mostly this is a result of being created before embed was included into Go.

I actually use the https://github.com/boyter/scc/blob/master/test-all.sh script which does it for me as well as running all tests, but this step is also included in the README https://github.com/boyter/scc/tree/master?tab=readme-ov-file#development

@boyter boyter merged commit d70def7 into boyter:master Apr 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants