# How to highlight ATS code in a web page?

**URL:** <https://discourse.ats-lang.org/t/how-to-highlight-ats-code-in-a-web-page/98>\
**Category:** Google Group\
**Created:** [December 29, 2013, 9:59pm UTC](https://discourse.ats-lang.org/t/how-to-highlight-ats-code-in-a-web-page/98 "2013-12-29T21:59:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [December 29, 2013, 9:59pm UTC](https://discourse.ats-lang.org/t/how-to-highlight-ats-code-in-a-web-page/98/1 "2013-12-29T21:59:26Z")

</div>

The following page contains some syntax-highlighted ATS code:

[http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/mergesort/main.html](http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/mergesort/main.html)

One way to do this is to first build the command ‘pats2xhtml’. The source  
code  
for the command is in the following directory:

${PATSHOME}/utils/atsynmark/

However, you need ATS1 to build ‘pats2xhtml’.

Then you can use ‘pats2xhtml’ to translates ATS code into XHTML code; then  
perform copy/paste.

Another approach is to build the command ‘atsdoc’ (available in ATS1) and  
then  
use it to process .atxt files.

Here is the .atxt source for the above main.html:

> <https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/EFFECTIVATS/mergesort/main.atxt>

Some information on atsdoc can be found here:

[http://www.ats-lang.org/htdocs-old/DOCUMENT/atsdocman/atsdocman.html](http://www.ats-lang.org/htdocs-old/DOCUMENT/atsdocman/atsdocman.html)

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [January 19, 2014, 6:05pm UTC](https://discourse.ats-lang.org/t/how-to-highlight-ats-code-in-a-web-page/98/2 "2014-01-19T18:05:28Z")

</div>

As a point of related interest and possible future project, github’s source  
highlighting engine is apparently written entirely in python  
([http://pygments.org/](http://pygments.org/) ).On Sunday, December 29, 2013 4:59:26 PM UTC-5, gmhwxi wrote:

> The following page contains some syntax-highlighted ATS code:
> 
> [http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/mergesort/main.html](http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/mergesort/main.html)
> 
> One way to do this is to first build the command ‘pats2xhtml’. The source  
> code  
> for the command is in the following directory:
> 
> ${PATSHOME}/utils/atsynmark/
> 
> However, you need ATS1 to build ‘pats2xhtml’.
> 
> Then you can use ‘pats2xhtml’ to translates ATS code into XHTML code; then  
> perform copy/paste.
> 
> Another approach is to build the command ‘atsdoc’ (available in ATS1) and  
> then  
> use it to process .atxt files.
> 
> Here is the .atxt source for the above main.html:
> 
> [EFFECTIVATS-mergesort](https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/EFFECTIVATS/mergesort/main.atxt)
> 
> Some information on atsdoc can be found here:
> 
> [http://www.ats-lang.org/htdocs-old/DOCUMENT/atsdocman/atsdocman.html](http://www.ats-lang.org/htdocs-old/DOCUMENT/atsdocman/atsdocman.html)

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [January 28, 2014, 10:03pm UTC](https://discourse.ats-lang.org/t/how-to-highlight-ats-code-in-a-web-page/98/3 "2014-01-28T22:03:20Z")

</div>

This is what Matthew Danish uses:

[http://cs-people.bu.edu/md/atslistings.styOn](http://cs-people.bu.edu/md/atslistings.styOn) Tuesday, January 28, 2014 4:57:21 PM UTC-5, Brandon Barker wrote:

> Is there currently a preferred way to convert code to highlighted code in  
> LaTeX? If not, there are several potential html-\>latex  
> [http://tex.stackexchange.com/questions/3079/how-do-i-convert-html-to-latex](http://tex.stackexchange.com/questions/3079/how-do-i-convert-html-to-latex)converters  
> I may try just to see if anything is reasonable. It seems like the most  
> promising route would be pats2xhtml → ConTeXt.
> 
> On Sunday, December 29, 2013 4:59:26 PM UTC-5, gmhwxi wrote:
> 
> > The following page contains some syntax-highlighted ATS code:
> > 
> > [http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/mergesort/main.html](http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/mergesort/main.html)
> > 
> > One way to do this is to first build the command ‘pats2xhtml’. The source  
> > code  
> > for the command is in the following directory:
> > 
> > ${PATSHOME}/utils/atsynmark/
> > 
> > However, you need ATS1 to build ‘pats2xhtml’.
> > 
> > Then you can use ‘pats2xhtml’ to translates ATS code into XHTML code; then  
> > perform copy/paste.
> > 
> > Another approach is to build the command ‘atsdoc’ (available in ATS1) and  
> > then  
> > use it to process .atxt files.
> > 
> > Here is the .atxt source for the above main.html:
> > 
> > [EFFECTIVATS-mergesort](https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/EFFECTIVATS/mergesort/main.atxt)
> > 
> > Some information on atsdoc can be found here:
> > 
> > [http://www.ats-lang.org/htdocs-old/DOCUMENT/atsdocman/atsdocman.html](http://www.ats-lang.org/htdocs-old/DOCUMENT/atsdocman/atsdocman.html)

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [January 28, 2014, 9:57pm UTC](https://discourse.ats-lang.org/t/how-to-highlight-ats-code-in-a-web-page/98/4 "2014-01-28T21:57:21Z")

</div>

Is there currently a preferred way to convert code to highlighted code in  
LaTeX? If not, there are several potential html-\>latex  
[http://tex.stackexchange.com/questions/3079/how-do-i-convert-html-to-latex](http://tex.stackexchange.com/questions/3079/how-do-i-convert-html-to-latex)converters  
I may try just to see if anything is reasonable. It seems like the most  
promising route would be pats2xhtml → ConTeXt.On Sunday, December 29, 2013 4:59:26 PM UTC-5, gmhwxi wrote:

> The following page contains some syntax-highlighted ATS code:
> 
> [http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/mergesort/main.html](http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/mergesort/main.html)
> 
> One way to do this is to first build the command ‘pats2xhtml’. The source  
> code  
> for the command is in the following directory:
> 
> ${PATSHOME}/utils/atsynmark/
> 
> However, you need ATS1 to build ‘pats2xhtml’.
> 
> Then you can use ‘pats2xhtml’ to translates ATS code into XHTML code; then  
> perform copy/paste.
> 
> Another approach is to build the command ‘atsdoc’ (available in ATS1) and  
> then  
> use it to process .atxt files.
> 
> Here is the .atxt source for the above main.html:
> 
> [EFFECTIVATS-mergesort](https://github.com/githwxi/ATS-Postiats/blob/master/doc/EXAMPLE/EFFECTIVATS/mergesort/main.atxt)
> 
> Some information on atsdoc can be found here:
> 
> [http://www.ats-lang.org/htdocs-old/DOCUMENT/atsdocman/atsdocman.html](http://www.ats-lang.org/htdocs-old/DOCUMENT/atsdocman/atsdocman.html)
