Editing Books (#13535)

* start work on ui

* Move notebooks complete

* Simplify version handling

* fix issues with add section method

* fix issues with the edit experience and add the quick pick for editing

* add version handler for re-writing tocs

* fix book toc manager tests

* add notebook test

* fix localize constant

* normalize paths on windows

* check that a section has sections before attempting to mve files

* Implement method for renaming duplicated files

* moving last notebook from section converts the section into notebook

* Add recovery method restore original state of file system

* Add clean up, for files that are copied instead of renamed

* remove dir complexity

* divide edit book in methods for easier testing and remove promise chain

* Keep structure of toc

* normalize paths on windows

* fix external link

* Add other fields for versions

* fix paths in uri of findSection

* add section to section test

* Add error messages

* address pr comments and add tests

* check that the new path of a notebook is different from the original path before deleting
This commit is contained in:
Barbara Valdez
2021-02-02 20:39:11 -08:00
committed by GitHub
parent 41915bda8d
commit 9ac180d772
13 changed files with 1296 additions and 595 deletions

View File

@@ -86,11 +86,11 @@ export interface IJupyterBookSectionV1 {
/**
* Contains a list of more entries that make up the chapter's/section's sub-sections
*/
sections?: IJupyterBookSectionV1[];
sections?: JupyterBookSection[];
/**
* If the section shouldn't have a number in the sidebar
*/
not_numbered?: string;
not_numbered?: boolean;
/**
* If you'd like the sections of this chapter to always be expanded in the sidebar.
*/
@@ -113,7 +113,7 @@ export interface IJupyterBookSectionV1 {
/**
* Will insert a header with no link in the sidebar
*/
header?: boolean;
header?: string;
}
/**
@@ -134,7 +134,7 @@ export interface IJupyterBookSectionV2 {
/**
* Contains a list of more entries that make up the chapter's/section's sub-sections
*/
sections?: IJupyterBookSectionV2[];
sections?: JupyterBookSection[];
/**
* If the section shouldn't have a number in the sidebar
*/
@@ -147,8 +147,23 @@ export interface IJupyterBookSectionV2 {
* External link
*/
url?: string;
// Below are some special values that trigger specific behavior:
/**
* Will insert a header with no link in the sidebar
*/
header?: string;
/**
* If a book is divided into groups then part is the title of the group
*/
part?: string;
/**
* the equivalent of sections in a group.
*/
chapters?: string[];
}
// type that supports new and old version
export type JupyterBookSection = IJupyterBookSectionV1 | IJupyterBookSectionV2;
export interface JupyterBookSection extends IJupyterBookSectionV1, IJupyterBookSectionV2 { }