1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

Spreadsheet: Add support for example views and hyperlinks in the docs

Now the functions can actually be demonstrated by small examples,
embedded right inside the documentation via:
spreadsheet://example/<page>#<example_name>

Also allows pages to link to each other via the same scheme:
spreadsheet://doc/<page>
This commit is contained in:
AnotherTest 2020-10-31 16:52:13 +03:30 committed by Andreas Kling
parent a598a2c19d
commit 1bd3a2d09f
6 changed files with 310 additions and 23 deletions

View file

@ -186,10 +186,18 @@ void SpreadsheetWidget::add_sheet()
name.append("Sheet");
name.appendff(" {}", m_workbook->sheets().size() + 1);
auto& sheet = m_workbook->add_sheet(name.string_view());
NonnullRefPtrVector<Sheet> new_sheets;
new_sheets.append(m_workbook->add_sheet(name.string_view()));
setup_tabs(move(new_sheets));
}
void SpreadsheetWidget::add_sheet(NonnullRefPtr<Sheet>&& sheet)
{
ASSERT(m_workbook == &sheet->workbook());
NonnullRefPtrVector<Sheet> new_sheets;
new_sheets.append(sheet);
new_sheets.append(move(sheet));
m_workbook->sheets().append(new_sheets);
setup_tabs(new_sheets);
}