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

Port to nano/pico #13

Open
3 of 8 tasks
Ebedthan opened this issue Jan 4, 2018 · 20 comments
Open
3 of 8 tasks

Port to nano/pico #13

Ebedthan opened this issue Jan 4, 2018 · 20 comments

Comments

@Ebedthan
Copy link
Contributor

Ebedthan commented Jan 4, 2018

Hey everybody

I have choose to invest my last night in writing syntax highlighting for nano/pico. I an writing the manual for develop nano syntax highlighting.

Take a look at what i have done so far.
image
I think i will finish porting tonight.


Instructions of developing Pico Syntax

  1. Create a *.nanorc file defining syntax highlighting.
  2. Copy this file to /usr/share/nano/ and to ~/.nano/syntax/ (the first path should also contains .nanorc files by default for others languages such as php, perl, etc., they don't need to be copied to ~/.nanorc/ file but the following step should be done to see colors).
  3. Add this path to these files by creating/editing ~/.nanorc doing nano ~/.nanorc and add include /usr/share/nano/*.nanorc.
  4. After that you will be able to see colors in your nano/pico editor.

Syntaxes TODO for pico

  • Fasta (.fa) [Anicet]
  • Fastq (.fq) [Anicet]
  • Bed (.bed)
  • Clustal (.clustal)
  • GTF (.gtf)
  • PDB (.pdb)
  • VCF (.vcf)
  • SAM (.sam)
@ababaian
Copy link
Member

ababaian commented Jan 4, 2018

Looks great @Ebedthan, can you start a git-branch called nano while you're working on this so that things are not pushed to master (which is for releases). Once all core-nano syntaxes are finished we can merge the nano branch with master.

@Ebedthan
Copy link
Contributor Author

Ebedthan commented Jan 4, 2018

ok @ababaian

1 similar comment
@Ebedthan
Copy link
Contributor Author

Ebedthan commented Jan 4, 2018

ok @ababaian

@Ebedthan
Copy link
Contributor Author

Ebedthan commented Jan 4, 2018

@ababaian i think we can't define new colors in nano. My research don't gave me results as expected. If you have any informations on how to add colors in nano for syntax highlighting, please let me know.
So far with colors set in nano we can't define colors for many files.

@ababaian
Copy link
Member

ababaian commented Jan 4, 2018

It's probably ANSI escape colors and/or System colors. Less and even terminal-vim has the same issue but even partial coloring with 16 colors is much better then nothing at all.

We just have to work within the framework of what is possible. With just Red / Green / Blue / Orange / White / Black and Bold / Italics and Background / Foreground you can accomplish about 90% of the functionality of bioSyntax. In the colors excel spreadsheet look at the last columns for ANSI/System colors where they are applicable.

@Ebedthan
Copy link
Contributor Author

Ebedthan commented Jan 4, 2018

Ok I take a look.

@Ebedthan
Copy link
Contributor Author

Ebedthan commented Jan 4, 2018

Please @ababaian could you let me know the link to the excel spreadsheet ?

@ababaian
Copy link
Member

ababaian commented Jan 4, 2018

dev/theme/bioSyntax_theme.xls link

@ababaian
Copy link
Member

ababaian commented Jan 8, 2018

How is it coming along @Ebedthan? Do you have guidelines / instructions on the work-flow?

@Ebedthan
Copy link
Contributor Author

Ebedthan commented Jan 9, 2018

Hey @ababaian

Yes i have instructions.
First you need to create a *.nanorc file defining syntax highlighting.
Secondly you need to copy this file to /usr/share/nano/ and to ~/.nano/syntax/ (the first path should also contains .nanorc files by default for others languages such as php, perl, etc., they don't need to be copied to ~/.nanorc/ file but the following step should be done to see colors).
Thirdly you need to add path to these files by creating/editing ~/.nanorc doing nano ~/.nanorc and add include /usr/share/nano/*.nanorc.
After that you will be able to see colors in your nano/pico editor.

@ababaian
Copy link
Member

ababaian commented Jan 9, 2018

KK Anicet, I've copied your instructions to the top of the post to organize the information a bit. Keep us all updated about your progress with the pico syntaxes or if you run into trouble 👍

@Ebedthan
Copy link
Contributor Author

ok @ababaian

@Ebedthan
Copy link
Contributor Author

Hello everybody,
I have create the nano branch. Add fasta and fastq.nanorc files. Follow instructions above in the first comment to test it on your computer.

@ababaian
Copy link
Member

Hows it coming along Anicet? Maybe one of the other @bioSyntax/devs can help out? This syntax format looks pretty tricky with the limitations. Have you found any good online guides on writing in-depth syntax files?

@Ebedthan
Copy link
Contributor Author

Yes @ababaian i have uploaded works i'vé already finish on the nano branch. Take a look. I will upload guidelines today.

@Ebedthan
Copy link
Contributor Author

Ebedthan commented Jan 17, 2018

Hey everybody

I have finished with bed, fasta and fastq syntax. If anyone wants to help for the others files types it would be very nice.
The limitations of colours is really a problem.

image

image

image

@Ebedthan
Copy link
Contributor Author

Hey @ababaian, since Valid colors in nano are white, black, red, blue, green, yellow, magenta, cyan.
And for foreground colors, the use of the prefix "bright" to get a stronger highlight are the only ways to define syntax highlighting, i have found difficult to define syntax for sam, gtf, pdb files for examples.

@ababaian
Copy link
Member

ababaian commented Jan 23, 2018

Can you add at minimum white text to the FASTQ PHRED score? Right now it's unreadable as is.

Start with GTF before SAM/VCF/PDB which is the simplest from that list. Can you get a Robust Column Selection regular expressions defined, that's more important then all the color details.

If you're able to write the logic in nano to arbitrarily select columns I'll be able to define a color scheme which works within the palette available. It may not be a perfect match but less only uses about 8 colors too and it works. When you can exploit 8 colors + bright + bg/fg selections you end up with lots of choices.

@alyeffy
Copy link
Member

alyeffy commented May 9, 2018

#2 task 8

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

6 participants