# Syntax-hilighting for ATS code in docbook

**URL:** <https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315>\
**Category:** Google Group\
**Created:** [February 24, 2016, 7:38am UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315 "2016-02-24T07:38:59Z")\
**Posts on this page:** 9\
**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:** [February 24, 2016, 7:38am UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/1 "2016-02-24T07:38:59Z")

</div>

With the help of the atexting tool, I managed to syntax-hilight the ATS  
code in docbook.  
I had wanted to do this for so long 🙂

For instance, please take a look at this book chapter:

[http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c359.html](http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c359.html)

The texting functions for syntax-hilighting are sats2xhtml and dats2xhtml:

[https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats](https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats)

Cheers!

---

<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:** [May 7, 2016, 12:33pm UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/2 "2016-05-07T12:33:26Z")

</div>

You need to have config.h available at ${ATSHOME} (not ${PATSHOME)).On Sat, May 7, 2016 at 1:01 AM, Kiwamu Okabe [kiw...@debian.or.jp](mailto:kiw...@debian.or.jp) wrote:

> On Sat, May 7, 2016 at 1:50 PM, gmhwxi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> 
> > You need now to execute
> > 
> > ‘make synhilit’
> > 
> > to syntax-hilight the ATS code in the book.
> 
> Do you mean following commands?
> 
> ```auto
> $ pwd
> /home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS
> $ make
> $ make -C ATEXT
> $ make -C HTML synhilit
> 
> ```
> 
> However I catch following error…
> 
> ```auto
> $ pwd
> /home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS
> $ make -C ATEXT
> make: Entering directory
> '/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/ATEXT'
> \
> /home/kiwamu/src/ATS-Postiats/bin/patscc -O2 -o bin/myatexting \
> -D_ATS_GCBDW \
> -DATS_MEMALLOC_GCBDW \
> myatexting.dats
> /home/kiwamu/src/ATS-Postiats/utils/atexting/atexting_mylib.dats \
> /home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c
> -L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib
> -L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib64 -latsynmark
> -latsopt -lats -lgmp -lgc
> 
> /home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c:36:20:
> fatal error: config.h: No such file or directory
> compilation terminated.
> 
> ```
> 
> It needs running “configure” at top directory?  
> But I catch more fail at “configure”.
> 
> ```auto
> $ pwd
> /home/kiwamu/src/ATS-Postiats
> $ autoreconf
> $ ./configure
> checking for gcc... gcc
> checking whether the C compiler works... yes
> checking for C compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> configure: error: cannot find install-sh, install.sh, or shtool in "."
> "./.." "./../.."
> 
> ```
> 
> ## Best regards,
> 
> Kiwamu Okabe at METASEPI DESIGN
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [https://groups.google.com/group/ats-lang-users](https://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dkktAO3O52NufAxVgCnD2963NKR5-Gg4VAGZx%2BO%3DqB1rA%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dkktAO3O52NufAxVgCnD2963NKR5-Gg4VAGZx%2BO%3DqB1rA%40mail.gmail.com)  
> .

---

<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:** [February 25, 2016, 3:23am UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/3 "2016-02-25T03:23:03Z")

</div>

FYI.

All the ATS code in INT2PROGINATS is now syntax-hilited:

[http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/HTMLTOC/book1.htmlOn](http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/HTMLTOC/book1.htmlOn) Wednesday, February 24, 2016 at 9:35:32 AM UTC-5, gmhwxi wrote:

> FYI.
> 
> All the ATS code in ATS2TUTORIAL is now syntax-hilited:
> 
> [A Tutorial on Programming Features in ATS](http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/book1.html)
> 
> On Wednesday, February 24, 2016 at 2:38:59 AM UTC-5, gmhwxi wrote:
> 
> > With the help of the atexting tool, I managed to syntax-hilight the ATS  
> > code in docbook.  
> > I had wanted to do this for so long 🙂
> > 
> > For instance, please take a look at this book chapter:
> > 
> > [Datatypes](http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c359.html)
> > 
> > The texting functions for syntax-hilighting are sats2xhtml and dats2xhtml:
> > 
> > [https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats](https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats)
> > 
> > Cheers!

---

<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:** [May 7, 2016, 1:17pm UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/4 "2016-05-07T13:17:25Z")

</div>

You are almost there.

cd ${PATSHOME}/utils/libatsopt

make

cd ${PATSHOME}/utlls/libatsynmark

make

After building libatsopt and libatsynmark, you can move them to  
${ATSHOME}/ccomp/lib

Then it should work.On Sat, May 7, 2016 at 9:08 AM, Kiwamu Okabe [kiw...@debian.or.jp](mailto:kiw...@debian.or.jp) wrote:

> On Sat, May 7, 2016 at 10:02 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> 
> > Try
> > 
> > cp ${ATSHOME}/config.h ${PATSHOME}/.
> 
> ```auto
> $ pwd
> /home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS
> $ cp ${ATSHOME}/config.h ${PATSHOME}/
> $ make -C ATEXT
> make: Entering directory
> '/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/ATEXT'
> \
> /home/kiwamu/src/ATS-Postiats/bin/patscc -O2 -o bin/myatexting \
> -D_ATS_GCBDW \
> -DATS_MEMALLOC_GCBDW \
> myatexting.dats
> /home/kiwamu/src/ATS-Postiats/utils/atexting/atexting_mylib.dats \
> /home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c
> -L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib
> -L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib64 -latsynmark
> -latsopt -lats -lgmp -lgc
> /usr/bin/ld: cannot find -latsynmark
> /usr/bin/ld: cannot find -latsopt
> collect2: error: ld returned 1 exit status
> Makefile:33: recipe for target 'myatexting' failed
> 
> ```
> 
> The `libatsynmark` and `libatsopt` come from ATS1?
> 
> ## Best regards,l
> 
> Kiwamu Okabe at METASEPI DESIGN
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [https://groups.google.com/group/ats-lang-users](https://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dndgC02e3\_aq45ofS6\_TYFZf6sADm6%2BJC0-xDA1O0BLxA%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dndgC02e3_aq45ofS6_TYFZf6sADm6%2BJC0-xDA1O0BLxA%40mail.gmail.com)  
> .

---

<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:** [May 7, 2016, 1:02pm UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/5 "2016-05-07T13:02:21Z")

</div>

Try

cp ${ATSHOME}/config.h ${PATSHOME}/.On Sat, May 7, 2016 at 8:46 AM, Kiwamu Okabe [kiw...@debian.or.jp](mailto:kiw...@debian.or.jp) wrote:

> On Sat, May 7, 2016 at 9:33 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> 
> > You need to have config.h available at ${ATSHOME} (not ${PATSHOME)).
> 
> Umm… I have it at ${ATSHOME}…
> 
> ```auto
> $ pwd
> /home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS
> $ make -C ATEXT
> make: Entering directory
> '/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/ATEXT'
> \
> /home/kiwamu/src/ATS-Postiats/bin/patscc -O2 -o bin/myatexting \
> -D_ATS_GCBDW \
> -DATS_MEMALLOC_GCBDW \
> myatexting.dats
> /home/kiwamu/src/ATS-Postiats/utils/atexting/atexting_mylib.dats \
> /home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c
> -L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib
> -L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib64 -latsynmark
> -latsopt -lats -lgmp -lgc
> 
> /home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c:36:20:
> fatal error: config.h: No such file or directory
> compilation terminated.
> Makefile:33: recipe for target 'myatexting' failed
> make: *** [myatexting] Error 1
> make: Leaving directory
> '/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/ATEXT'
> $ file $ATSHOME/config.h
> /home/kiwamu/src/ats-lang-anairiats-0.2.12/config.h: ASCII text
> 
> ```
> 
> ## Best regards,
> 
> Kiwamu Okabe at METASEPI DESIGN
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [https://groups.google.com/group/ats-lang-users](https://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dkxDE\_6E4xE-%3DLyQnOrhTjVWvzi-iOEiZH7o03UuNUegw%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dkxDE_6E4xE-%3DLyQnOrhTjVWvzi-iOEiZH7o03UuNUegw%40mail.gmail.com)  
> .

---

<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:** [February 24, 2016, 2:35pm UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/6 "2016-02-24T14:35:31Z")

</div>

FYI.

All the ATS code in ATS2TUTORIAL is now syntax-hilited:

[http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/book1.htmlOn](http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/book1.htmlOn) Wednesday, February 24, 2016 at 2:38:59 AM UTC-5, gmhwxi wrote:

> With the help of the atexting tool, I managed to syntax-hilight the ATS  
> code in docbook.  
> I had wanted to do this for so long 🙂
> 
> For instance, please take a look at this book chapter:
> 
> [Datatypes](http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c359.html)
> 
> The texting functions for syntax-hilighting are sats2xhtml and dats2xhtml:
> 
> [https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats](https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats)
> 
> Cheers!

---

<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:** [May 7, 2016, 4:50am UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/7 "2016-05-07T04:50:29Z")

</div>

You need now to execute

‘make synhilit’

to syntax-hilight the ATS code in the book.On Wednesday, February 24, 2016 at 2:38:59 AM UTC-5, gmhwxi wrote:

> With the help of the atexting tool, I managed to syntax-hilight the ATS  
> code in docbook.  
> I had wanted to do this for so long 🙂
> 
> For instance, please take a look at this book chapter:
> 
> [Datatypes](http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c359.html)
> 
> The texting functions for syntax-hilighting are sats2xhtml and dats2xhtml:
> 
> [https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats](https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats)
> 
> Cheers!

---

<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:** [May 7, 2016, 1:31pm UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/8 "2016-05-07T13:31:47Z")

</div>

Please take a look at the following script to see how libatsopt can be  
built:

[https://github.com/ats-lang/ats-lang.github.io/blob/master/SCRIPT/C9-ATS2-install-latest.shOn](https://github.com/ats-lang/ats-lang.github.io/blob/master/SCRIPT/C9-ATS2-install-latest.shOn) Sat, May 7, 2016 at 9:23 AM, Kiwamu Okabe [kiw...@debian.or.jp](mailto:kiw...@debian.or.jp) wrote:

> On Sat, May 7, 2016 at 10:17 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:
> 
> > You are almost there.
> > 
> > cd ${PATSHOME}/utils/libatsopt
> > 
> > make
> > 
> > cd ${PATSHOME}/utlls/libatsynmark
> > 
> > make
> > 
> > After building libatsopt and libatsynmark, you can move them to  
> > ${ATSHOME}/ccomp/lib
> > 
> > Then it should work.
> 
> ```auto
> $ cd ${PATSHOME}/utils/libatsopt
> $ make
> --snip--
> gcc -O2 -I. -I./ccomp/runtime -c -o pats_ccomp_emit3_dats.o
> pats_ccomp_emit3_dats.c
> gcc -O2 -I. -I./ccomp/runtime -c -o pats_ccomp_main_dats.o
> pats_ccomp_main_dats.c
> gcc -O2 -I. -I./ccomp/runtime -c -o pats_comarg_dats.o pats_comarg_dats.c
> make[1]: *** No rule to make target 'prelude_basics_sta_sats.o',
> needed by 'prelude_libats.o'. Stop.
> make[1]: Leaving directory '/home/kiwamu/src/ATS-Postiats/src/CBOOT'
> Makefile:29: recipe for target 'libatsopt' failed
> 
> ```
> 
> –  
> Kiwamu Okabe at METASEPI DESIGN
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [https://groups.google.com/group/ats-lang-users](https://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dk25doAq0WU1fEdtgSpCWhTp3\_%3D-sKKzxd6q4H6v2M5MQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dk25doAq0WU1fEdtgSpCWhTp3_%3D-sKKzxd6q4H6v2M5MQ%40mail.gmail.com)  
> .

---

<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:** [May 7, 2016, 2:22pm UTC](https://discourse.ats-lang.org/t/syntax-hilighting-for-ats-code-in-docbook/315/9 "2016-05-07T14:22:42Z")

</div>

I modified that script a bit. You can now use it to build libatsopt and  
libatsynmark.On Saturday, May 7, 2016 at 9:31:48 AM UTC-4, gmhwxi wrote:

> Please take a look at the following script to see how libatsopt can be  
> built:
> 
> [https://github.com/ats-lang/ats-lang.github.io/blob/master/SCRIPT/C9-ATS2-install-latest.sh](https://github.com/ats-lang/ats-lang.github.io/blob/master/SCRIPT/C9-ATS2-install-latest.sh)
> 
> On Sat, May 7, 2016 at 9:23 AM, Kiwamu Okabe wrote:
> 
> > On Sat, May 7, 2016 at 10:17 PM, Hongwei Xi wrote:
> > 
> > > You are almost there.
> > > 
> > > cd ${PATSHOME}/utils/libatsopt
> > > 
> > > make
> > > 
> > > cd ${PATSHOME}/utlls/libatsynmark
> > > 
> > > make
> > > 
> > > After building libatsopt and libatsynmark, you can move them to  
> > > ${ATSHOME}/ccomp/lib
> > > 
> > > Then it should work.
> > 
> > ```auto
> > $ cd ${PATSHOME}/utils/libatsopt
> > $ make
> > --snip--
> > gcc -O2 -I. -I./ccomp/runtime -c -o pats_ccomp_emit3_dats.o
> > pats_ccomp_emit3_dats.c
> > gcc -O2 -I. -I./ccomp/runtime -c -o pats_ccomp_main_dats.o
> > pats_ccomp_main_dats.c
> > gcc -O2 -I. -I./ccomp/runtime -c -o pats_comarg_dats.o pats_comarg_dats.c
> > make[1]: *** No rule to make target 'prelude_basics_sta_sats.o',
> > needed by 'prelude_libats.o'. Stop.
> > make[1]: Leaving directory '/home/kiwamu/src/ATS-Postiats/src/CBOOT'
> > Makefile:29: recipe for target 'libatsopt' failed
> > 
> > ```
> > 
> > –  
> > Kiwamu Okabe at METASEPI DESIGN
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “ats-lang-users” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [https://groups.google.com/group/ats-lang-users](https://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dk25doAq0WU1fEdtgSpCWhTp3\_%3D-sKKzxd6q4H6v2M5MQ%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dk25doAq0WU1fEdtgSpCWhTp3_%3D-sKKzxd6q4H6v2M5MQ%40mail.gmail.com)  
> > .
