mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 14:05:15 +00:00
For a subsection named `Foo` with a markdown file `Foo.md` in the same directory, the document `Foo.md` will be returned when the subsection is selected. This prevents PageNodes and SubsectionNodes from sharing the same name, which fixes an issue in Help where subsections could not be navigated.
32 lines
794 B
C++
32 lines
794 B
C++
/*
|
|
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibManual/PageNode.h>
|
|
#include <LibManual/SectionNode.h>
|
|
|
|
namespace Manual {
|
|
|
|
// A non-toplevel (i.e. not numbered) manual section.
|
|
class SubsectionNode : public SectionNode {
|
|
public:
|
|
SubsectionNode(NonnullRefPtr<SectionNode const> parent, StringView name, RefPtr<PageNode> page = {});
|
|
virtual ~SubsectionNode() = default;
|
|
|
|
virtual Node const* parent() const override;
|
|
virtual ErrorOr<String> path() const override;
|
|
virtual ErrorOr<String> name() const override;
|
|
virtual PageNode const* document() const override;
|
|
|
|
protected:
|
|
NonnullRefPtr<SectionNode const> m_parent;
|
|
|
|
private:
|
|
RefPtr<PageNode> m_page;
|
|
};
|
|
|
|
}
|