okular/generators/markdown/converter.h
Julian Wolff 4931385777 add markdown support
Summary:
Adds support for Markdown documents

BUG: 360603

Test Plan: Open a Markdown (.md) document in Okular

Reviewers: #okular, aacid

Reviewed By: #okular, aacid

Subscribers: michaelweghorn, aacid

Tags: #okular

Differential Revision: https://phabricator.kde.org/D7382
2017-08-25 01:05:23 +02:00

48 lines
1.3 KiB
C++

/***************************************************************************
* Copyright (C) 2017 by Julian Wolff <wolff@julianwolff.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef MARKDOWN_CONVERTER_H
#define MARKDOWN_CONVERTER_H
#include <QDir>
#include <core/textdocumentgenerator.h>
class QTextCursor;
class QTextFrame;
namespace Markdown {
class Converter : public Okular::TextDocumentConverter
{
Q_OBJECT
public:
Converter();
~Converter();
QTextDocument *convert( const QString &fileName ) override;
private:
void convertLinks();
void convertImages();
void convertLinks(QTextFrame *parent);
void convertLinks(QTextBlock& parent);
void convertImages(QTextFrame *parent);
void convertImages(QTextBlock& parent);
QTextDocument *mTextDocument;
QDir mDir;
};
}
#endif