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

Don't have all spec markup using markdown when not using a .md file. #219

Open
custa1200 opened this issue Apr 29, 2016 · 7 comments
Open

Comments

@custa1200
Copy link

When I use the index.src.html spec file and use I can't understand from the examples how I add the:

.source_info
.source_warn
.source_doc
.source_a_d
.source_a_s
.source_hl
.source_a_hl

that are defined in https://sourcejs.com/docs/spec/

I tried doing a:

``` info
Text in here
\```

But it didn't work (I really wish there was an easy way to add markdown into markdown, excuse the \ )

also would it be better if they were in the format of .sourcejs-info, sourcejs-warn, etc? Which also begs the question should the code blocks be sourcejs-css instead of src-css to keep it all consistent? It would be great if somebody like a BA with no coding knowledge would be able write all the spec text using MD

@custa1200
Copy link
Author

Or is it only abled to be handled mixing markdown and HTML?

@robhrt7
Copy link
Member

robhrt7 commented Apr 29, 2016

Nice point you have here, indeed these block types are not implemented yet. But you can mix HTML with markdown to make it work.

It would be really useful to have those helpers generated from markdown like:

```info
Text in here
```

```warn
Text in here
```

It's also a good task for a first contribution, so PR's are welcome. Here's the file you can start with https://github.com/sourcejs/Source/blob/master/core/lib/processMd.js.

@ndelangen
Copy link
Member

Theoretically other plugins can add even more block-types?
Should we implement some naming convention to prevent name-clashing?

```core:info
This is an example info text
\```

@robhrt7
Copy link
Member

robhrt7 commented May 1, 2016

Right now plugins can do that only if a user sets those renderers in his config, like here https://github.com/mik01aj/sourcejs-md-react

module.exports = {
    core: {
        processMd: {
            languageRenderers: {
                'jsx-init-server': require('sourcejs-md-react/lang-jsx').processServerInit,
                'jsx-init-client': require('sourcejs-md-react/lang-jsx').processClientInit,
                'jsx-component-init-common': require('sourcejs-md-react/lang-jsx').processComponentInit,
                'jsx': require('sourcejs-md-react/lang-jsx').processExample,
            }
        }
        // ...
    }
    // ...
};

@robhrt7 robhrt7 closed this as completed May 1, 2016
@robhrt7 robhrt7 reopened this May 1, 2016
@custa1200
Copy link
Author

@operatino I'l try to get this organised sometime if the next few days. I have not submitted a PR to any projects before, so I might need some hand holding for my first one in here.

@robhrt7
Copy link
Member

robhrt7 commented May 2, 2016

@custa1200 no worries, feel free to ask any advice, I'll be happy to help.

You can also open a PR just to validate the approach, or ask for help, we've been doing the same with @ndelangen, he also was doing his first OS contributions to SourceJS.

@custa1200
Copy link
Author

So I have added a PR with #222 hope it's ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants