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

Determine file type and comment name accordingly #7

Open
bmuenzenmeyer opened this issue Aug 6, 2021 · 0 comments
Open

Determine file type and comment name accordingly #7

bmuenzenmeyer opened this issue Aug 6, 2021 · 0 comments

Comments

@bmuenzenmeyer
Copy link
Contributor

Markdown injection currently places a block like this:

File: foo/bar.js

console.log('Hello World')

We traditionally document files, instead, like this:

// foo/bar.js
console.log('Hello World')

We should find a library or write up some code that takes our common markdown languages and creates file name comments out of them. In some cases (like json), we may just need to retain the File: ___ message.

Examples:

<!-- index.html -->
<div>Hello World</div>
# deploy.sh
npm run release
git push --follow-tags origin main
# .vela.yml
steps:
  - name: test
    image: node
    commands:
      - npm i
      - npm test
File: package.json

{
  "name": "my-app",
  "scripts": {
    "start": "praxis-scripts start"
  },
  "dependencies": {
    "praxis-scripts": "10.1.0"
  }
}
Alternatively, we could document JSON as json5
// package.json
{
  "name": "my-app",
  "scripts": {
    "start": "praxis-scripts start"
  },
  "dependencies": {
    "praxis-scripts": "10.1.0"
  }
}

Languages we have ```[lang] blocks of in the monorepo currently:

  • bash
  • diff
  • docker
  • js
  • json
  • jsx
  • markdown
  • nginx
  • sh
  • ts
  • txt
  • yaml

Languages we don't have but should probably support because they might sneak in:

  • yml (I usually write yaml this way)
  • tsx
  • json5?
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

No branches or pull requests

1 participant