mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
add support for #anchors within pages to help link code
This commit is contained in:
parent
594a344ec7
commit
18fdb53da8
@ -224,18 +224,38 @@ void HelpSystem::ShowHelpDialog(wxWindow *parent,
|
||||
|
||||
void HelpSystem::ShowHelpDialog(wxWindow *parent, const wxString &PageName)
|
||||
{
|
||||
wxString releasePageName(PageName);
|
||||
wxString localHelpPage;
|
||||
wxString webHelpPage;
|
||||
wxString releasePageName;
|
||||
wxString anchor;
|
||||
if (PageName.Find('#', true) != wxNOT_FOUND)
|
||||
{ // need to split anchor off into separate variable
|
||||
releasePageName= PageName.BeforeLast('#');
|
||||
anchor= PageName.AfterLast('#');
|
||||
}
|
||||
else
|
||||
{
|
||||
releasePageName = PageName;
|
||||
anchor = wxT("");
|
||||
}
|
||||
// This bit of code replicates the name transformations performed by the
|
||||
// clean_filename routine in scripts/mw2html_audacity/mw2html.py:
|
||||
// clean_filename routine in scripts/mw2html_audacity/mw2html.py
|
||||
// there is a special case for transforming the front page
|
||||
// (Main_Page => index.html)
|
||||
if (releasePageName == wxT("Main_Page"))
|
||||
{
|
||||
releasePageName = wxT("index") + HelpSystem::ReleaseSuffix + anchor;
|
||||
}
|
||||
else
|
||||
{ // for any other name
|
||||
releasePageName.Replace(wxT("%%"), wxT("_"), true);
|
||||
releasePageName.Replace(wxT("%25"), wxT("_"), true);
|
||||
releasePageName.Replace(wxT("%"), wxT("_"), true);
|
||||
releasePageName.Replace(wxT("-"), wxT("_"), true);
|
||||
releasePageName.Replace(wxT("__"), wxT("_"), true);
|
||||
releasePageName.Replace(wxT("_."), wxT("."), true);
|
||||
releasePageName = releasePageName.Lower()+HelpSystem::ReleaseSuffix;
|
||||
releasePageName = releasePageName.Lower()+HelpSystem::ReleaseSuffix + anchor;
|
||||
}
|
||||
|
||||
localHelpPage = wxFileName(FileNames::HtmlHelpDir()+wxT("/man/"), releasePageName).GetFullPath();
|
||||
#if IS_ALPHA
|
||||
|
Loading…
x
Reference in New Issue
Block a user