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

Code snippet import #25

Closed
ijpatricio opened this issue Sep 15, 2018 · 3 comments
Closed

Code snippet import #25

ijpatricio opened this issue Sep 15, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@ijpatricio
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I already mentioned in future development #6 (comment)
but i'm not sure if you are seeing it...

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered

It's very useful for technical docs, and usage without having to change the source code.

Something like... -> single quote used to be seen as code block in this comment

'```snippet-php

filePath: app/MyClass.php 

firstLineQuery: public function myMethod

paddingTop: 4

lastLineQuery: return $something;

paddingBottom: 3

fileNumbers: true

highlightLinesQuery: some text

highlightLinesQuery: another text

'```

Description for inputs:

  • filePath: relative to base path, using later: base_path('app/MyClass.php')
  • first line query: public function myMethod
    (will find first line in file, with occurence of public function myMethod, and mark its line number)
    • If an integer, just use that integer as the line
  • last line query: return $something;
    (will find first line in file, with occurence of return $something;, and mark its line number)
    • If an integer, just use that integer as the line
  • lastLine > firstLine or throwException
  • fileNumbers: boolean
    use the line numbers from file
  • paddingTop/paddingBottom: signedInteger
    (padding to change first line and last linefor snippet) - useful for not having to place markers in source files
  • highlightLinesQuery: [some text,another text]
    will highlight lines containing some text and another text

Additional context

Similar to something I've done here

codemirrorusage

I already checked prism.js, all this is possible easily, check this plugin https://prismjs.com/plugins/line-numbers/

What do you think?

I will do it for me, but checking if we have alignment, maybe for another PR? 😄

@ijpatricio ijpatricio mentioned this issue Sep 15, 2018
21 tasks
@saleem-hadad saleem-hadad added the enhancement New feature or request label Sep 18, 2018
@ijpatricio
Copy link
Contributor Author

Nice that it wasn't closed. I believe very soon i'll be able to contribute this feature.

@saleem-hadad
Copy link
Owner

saleem-hadad commented Feb 15, 2019

Of course not, I understand we have other things to focus on as well, totally normal thing :D
Awesome that you get back working on it 😍❤️

@saleem-hadad
Copy link
Owner

will be added to the pro version as stated here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants