Beispiel #1
0
        private ProjectTreeNode NewProjectNode(DocumentationProject project)
        {
            ProjectTreeNode projectNode = new ProjectTreeNode(project, projectContextMenuStrip);

            UpdateSidebars(project.Sidebars, projectNode);

            return(projectNode);
        }
Beispiel #2
0
 public Form1()
 {
     InitializeComponent();
     ApplicationFileNameChanged += Form1_ApplicationFileNameChanged;
     AdjustSplitterWidth();
     Project = new DocumentationProject();
     Project.Sidebars.Add(new DocumentationSidebar()
     {
         Title = "Docs"
     });
 }
Beispiel #3
0
        private string ProjectSidebarsAsJson(DocumentationProject project)
        {
            if (project == null)
            {
                return(new JsonObject().ToString());
            }

            JsonObject jo = new JsonObject();

            foreach (var sidebar in project.Sidebars)
            {
                jo.Add(Surround(sidebar.Title), SidebarJsonTopics(sidebar.Topics));
            }
            return(jo.ToString());
        }
        internal DocumentationProject RetrieveProject()
        {
            DocumentationProject p = new DocumentationProject()
            {
                Title = Tag.ToString()
            };

            foreach (SidebarTreeNode sidebarNode in Nodes)
            {
                DocumentationSidebar sidebar = sidebarNode.RetrieveSidebar();
                p.Sidebars.Add(sidebar);
            }

            return(p);
        }
Beispiel #5
0
        private void buildToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DocumentationProject project = ((ProjectTreeNode)treeView1.TopNode).RetrieveProject();

            // Generate sidebars.js in Docusaurus website folder
            var sidebarsRuntimeTextTemplate = new SidebarsRuntimeTextTemplate();

            sidebarsRuntimeTextTemplate.Content = ProjectSidebarsAsJson(project);

            string sidebarsText     = sidebarsRuntimeTextTemplate.TransformText();
            string sidebarsFilename = "sidebars.js";

            File.WriteAllText(sidebarsFilename, sidebarsText);

            MessageBox.Show(string.Format(@"Sidebars file created."), "Docusaurus Documentation Project Outliner", MessageBoxButtons.OK);
        }
Beispiel #6
0
 private void GatherData()
 {
     Project = ((ProjectTreeNode)treeView1.TopNode).RetrieveProject();
 }
 public ProjectTreeNode(DocumentationProject project) : base()
 {
     Text = (!string.IsNullOrWhiteSpace(project.Title) ? project.Title : "Untitled");
     Tag  = project;
 }
 public ProjectTreeNode(DocumentationProject project, ContextMenuStrip projectContextMenuStrip) : this(project)
 {
     ContextMenuStrip = projectContextMenuStrip;
 }