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

be able to highlight inline Agda code #3283

Open
divipp opened this issue Oct 16, 2018 · 1 comment
Open

be able to highlight inline Agda code #3283

divipp opened this issue Oct 16, 2018 · 1 comment
Labels
type: enhancement Issues and pull requests about possible improvements ux: highlighting Issues relating to syntax highlighting
Milestone

Comments

@divipp
Copy link
Contributor

divipp commented Oct 16, 2018

It would be nice to be able to highlight inline Agda code approximately.
This would be used in literate Agda code.

There is an approximate Agda syntax highlighter in the skylighting Haskell package, but there could be also an approximate guess whether an identifier is a constructor or not too.

Example (suppose that markdown comments are supported, which is a separate issue):

\begin{code}
data A : Set where
    a : A
    b : A
\end{code}

Constructors `a` and `b` ... variables or functions `f` and `g` ...

a should be highlighted with different color than f in the printed output.

This issue is standalone part of a more ambitious plan to integrate pandoc and Agda. The ultimate goal is to be able to present Agda code easily (pandoc supports several output formats, including beamer slides and a few html presentation styles).

@divipp divipp added type: enhancement Issues and pull requests about possible improvements ux: highlighting Issues relating to syntax highlighting labels Oct 16, 2018
@gallais
Copy link
Member

gallais commented Oct 16, 2018

Note that there is already something a bit similar in the latex backend. Cf. the wiki

Semi-automatically typesetting inline code

Since Agda version 2.4.2 there is experimental support for semi-automatically typesetting code inside text, using the references option. Here is a full example.

Example.lagda

\documentclass{article}
\usepackage[references]{agda} 
\begin{document}

Here we postulate \AgdaRef{apa}.

\begin{code}
postulate apa : Set
\end{code}

\end{document}

@divipp divipp changed the title be able highlight inline Agda code be able to highlight inline Agda code Oct 16, 2018
@jespercockx jespercockx added this to the icebox milestone Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Issues and pull requests about possible improvements ux: highlighting Issues relating to syntax highlighting
Projects
None yet
Development

No branches or pull requests

3 participants