From: Richard Heck Date: Sat, 14 Nov 2009 14:12:37 +0000 (+0000) Subject: Get XHTML output for InsetRef working, again in a fairly primitive way. We just X-Git-Tag: 2.0.0~5157 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=85503ec1b96225c227c84dcfc0953f7532ea3c33;p=features.git Get XHTML output for InsetRef working, again in a fairly primitive way. We just use the label name as associated text, and put it into square brackets. It'd be nice to be able to do more, but for that we'd need to associate counters with the labels, which would be nice for display, too. But we don't have that yet. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31976 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index e24bd4f012..179ce9d990 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -18,6 +18,7 @@ #include "LaTeXFeatures.h" #include "LyXFunc.h" #include "OutputParams.h" +#include "output_xhtml.h" #include "ParIterator.h" #include "sgml.h" #include "TocBackend.h" @@ -115,6 +116,16 @@ int InsetRef::docbook(odocstream & os, OutputParams const & runparams) const } +docstring InsetRef::xhtml(odocstream & os, OutputParams const &) const +{ + // FIXME What we'd really like to do is to be able to output some + // appropriate sort of text here. But to do that, we need to associate + // some sort of counter with the label, and we don't have that yet. + docstring const ref = html::htmlize(getParam("reference")); + os << "[" << ref << "]"; + return docstring(); +} + void InsetRef::tocString(odocstream & os) const { plaintext(os, OutputParams(0)); diff --git a/src/insets/InsetRef.h b/src/insets/InsetRef.h index 1271ad1fd0..ae88ccdcf2 100644 --- a/src/insets/InsetRef.h +++ b/src/insets/InsetRef.h @@ -54,6 +54,8 @@ public: int plaintext(odocstream &, OutputParams const &) const; /// int docbook(odocstream &, OutputParams const &) const; + /// + docstring xhtml(odocstream &, OutputParams const &) const; /// the string that is passed to the TOC void tocString(odocstream &) const; /// @@ -61,7 +63,7 @@ public: /// static ParamInfo const & findInfo(std::string const &); /// - static std::string defaultCommand() { return "ref"; }; + static std::string defaultCommand() { return "ref"; } /// static bool isCompatibleCommand(std::string const & s); ///