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
This commit is contained in:
Richard Heck 2009-11-14 14:12:37 +00:00
parent cd35cebed1
commit 85503ec1b9
2 changed files with 14 additions and 1 deletions

View File

@ -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 << "<a href=\"" << ref << "\">[" << ref << "]</a>";
return docstring();
}
void InsetRef::tocString(odocstream & os) const
{
plaintext(os, OutputParams(0));

View File

@ -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);
///