summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-10-01 16:58:47 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-10-01 16:58:47 (GMT)
commite7fde5d604faf27dec989c8894e949d48676e0c1 (patch)
tree1cef6e8f9f8354043986dffd30741120e6bfb3b5 /src
parent47fee387821113956e10fffa79ea22062de8c817 (diff)
downloadDoxygen-e7fde5d604faf27dec989c8894e949d48676e0c1.zip
Doxygen-e7fde5d604faf27dec989c8894e949d48676e0c1.tar.gz
Doxygen-e7fde5d604faf27dec989c8894e949d48676e0c1.tar.bz2
issue_6517: Emoji support
Added issue support for the different output types. - Sources of the emoji - based on the Unicode definition v11.0: - https://unicode.org/emoji/charts/full-emoji-list.html - http://www.unicode.org/emoji/charts/full-emoji-modifiers.html - github definition list: - https://api.github.com/emojis - Input of emoji: :<test>: with the restriction that direct after the opening colon and direct before the closing colon no space is allowed - doctokinizer.l, adding detection of emoji and new command `\:` - doktokinizer.h, adding "word" type TK_EMOJI - docparser.* handling of new "word" type TK_EMOJI (analogous to HTML Entities), handling of new command `\:` - cmdmapper,cpp, cmdmapper.h, adding new command `\:` - htmlentity.cpp, adding new definition required for new command `\:` - Emoji - emoji.cpp, emoji.h, class for handling emoji analogous to HTML Entities, including small directions on how to update the code when a new emoji is defined. Not everything is converted to lowercase for comparison and accents are removed. - doxygen.cpp possibility to create list of supported emoji - handling emoji for output types (analogous to HTML Entities), see documentation for different output types - docparser.h, *docvisitor.* - rtfdocvisitor.* converting output to UTF-16 (based on http://scruss.com/blog/2017/03/12/in-the-unlikely-event-you-need-to-represent-emoji-in-rtf-using-perl/) - latexdocvisitor.*, handling arguments for emoji in output (see also latexgen.cpp for meaning of the arguments of doxygenemoji). - latexgen.cpp, adding new latex command for doxygen (doxygenemoji) and prevent too many open file (code before documentclass) - config.xml, definition of `LATEX_EMOJI_DIRECTORY` with path to images required for LaTeX output - Documentation: - emojisup.doc, user description - commands.doc, description of new command `\:` - index.doc, reference to emoji chapter - xmlcmds.doc, adjust reference to next chapter as a new chapter is added - Doxyfile*, adding emoji chapter Build system - CMakeLists.txt adding new files
Diffstat (limited to 'src')
-rw-r--r--src/latexdocvisitor.cpp50
-rw-r--r--src/xmldocvisitor.h1
2 files changed, 51 insertions, 0 deletions
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 452a481..3f90403 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -33,6 +33,7 @@
#include "filedef.h"
#include "config.h"
#include "htmlentity.h"
+#include "emoji.h"
#include "plantuml.h"
const int maxLevels=5;
@@ -210,6 +211,55 @@ void LatexDocVisitor::visit(DocSymbol *s)
}
}
+void LatexDocVisitor::visit(DocEmoji *s)
+{
+ if (m_hide) return;
+ const char *res_text = EmojiEntityMapper::instance()->text(s->emoji());
+ if (res_text)
+ {
+ const char *res_code = EmojiEntityMapper::instance()->code(s->emoji());
+ m_t << "\\doxygenemoji{";
+ filter(res_text);
+ m_t << "}{";
+ m_t << res_code;
+ m_t << "}{";
+ const char *p = res_code;
+ char res[10];
+ int i = 0;
+ bool first = TRUE;
+ while (*p)
+ {
+ switch(*p)
+ {
+ case '&': case '#': case 'x':
+ break;
+ case ';':
+ res[i] = '\0';
+ if (!first) m_t << "-";
+ m_t << res;
+ first = FALSE;
+ i = 0;
+ break;
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ res[i] = *p;
+ i++;
+ break;
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ res[i] = *p -'a' + 'A'; // so it is uppercase
+ i++;
+ break;
+ }
+ p++;
+ }
+ m_t << "}";
+ }
+ else
+ {
+ err("LaTeX: non supported Emoji-entity found: %s\n",EmojiEntityMapper::instance()->html(s->emoji()));
+ }
+}
+
void LatexDocVisitor::visit(DocURL *u)
{
if (m_hide) return;
diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h
index c65688f..c2c6537 100644
--- a/src/xmldocvisitor.h
+++ b/src/xmldocvisitor.h
@@ -41,6 +41,7 @@ class XmlDocVisitor : public DocVisitor
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
void visit(DocSymbol *);
+ void visit(DocEmoji *);
void visit(DocURL *);
void visit(DocLineBreak *);
void visit(DocHorRuler *);