Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: generate sub category summary #1699

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
yanglbme merged 17 commits into main from dev-category
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
- [剑指 Offer(专项突击版)](/lcof2/README.md)
- [程序员面试金典(第 6 版)](/lcci/README.md)

## 专项突破

- [JavaScript 专项练习](/solution/JAVASCRIPT_README.md)
- [数据库专项练习](/solution/DATABASE_README.md)

## 算法提升专题

### 1. 基础算法
Expand Down
5 changes: 5 additions & 0 deletions README_EN.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ The repository is maintained by the Doocs community, and please give us a [star]
- [LCOF: Coding Interviews, 2nd Edition](/lcof/README_EN.md)
- [LCCI: Cracking the Coding Interview, 6th Edition](/lcci/README_EN.md)

## JavaScript & Database Practice

- [JavaScript Practice](/solution/JAVASCRIPT_README_EN.md)
- [Database Practice](/solution/DATABASE_README_EN.md)

## Topics

### 1. Basic Algorithms
Expand Down
2 changes: 1 addition & 1 deletion lcci/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

列表所有题解均由 [开源社区 Doocs](https://github.com/doocs) 贡献者提供,正在完善中,欢迎贡献你的题解!

快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd>+<kbd>F</kbd>(或者 <kbd>Command</kbd>+<kbd>F</kbd>)。
快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd> + <kbd>F</kbd>(或者 <kbd>Command</kbd> + <kbd>F</kbd>)。

| 题号 | 题解 | 标签 | 难度 |
| --------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | --------------------------------------------- | ---- |
Expand Down
2 changes: 1 addition & 1 deletion lcci/README_EN.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _Cracking the Coding Interview, 6th Edition_ is here to help you through this pr

## Solutions

Press <kbd>Control</kbd>+<kbd>F</kbd>(or <kbd>Command</kbd>+<kbd>F</kbd> on the Mac) to search anything you want.
Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on the Mac) to search anything you want.

| # | Solution | Tag | Difficulty |
| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | ---------- |
Expand Down
2 changes: 1 addition & 1 deletion lcof/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

列表所有题解均由 [开源社区 Doocs](https://github.com/doocs) 贡献者提供,正在完善中,欢迎贡献你的题解!

快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd>+<kbd>F</kbd>(或者 <kbd>Command</kbd>+<kbd>F</kbd>)。
快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd> + <kbd>F</kbd>(或者 <kbd>Command</kbd> + <kbd>F</kbd>)。

| 题号 | 题解 | 标签 | 难度 |
| ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ---- |
Expand Down
2 changes: 1 addition & 1 deletion lcof/README_EN.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Readers will improve their interview performance after reading this book. It wil

English Solutions is not available for the book. Please switch to Chinese version.

Press <kbd>Control</kbd>+<kbd>F</kbd>(or <kbd>Command</kbd>+<kbd>F</kbd> on the Mac) to search anything you want.
Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on the Mac) to search anything you want.

## Copyright

Expand Down
2 changes: 1 addition & 1 deletion lcof2/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

列表所有题解均由 [开源社区 Doocs](https://github.com/doocs) 贡献者提供,正在完善中,欢迎贡献你的题解!

快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd>+<kbd>F</kbd>(或者 <kbd>Command</kbd>+<kbd>F</kbd>)。
快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd> + <kbd>F</kbd>(或者 <kbd>Command</kbd> + <kbd>F</kbd>)。

| 题号 | 题解 | 标签 | 难度 | 备注 |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ---- | ---- |
Expand Down
2 changes: 1 addition & 1 deletion lcp/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

列表所有题解均由 [开源社区 Doocs](https://github.com/doocs) 贡献者提供,正在完善中,欢迎贡献你的题解!

快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd>+<kbd>F</kbd>(或者 <kbd>Command</kbd>+<kbd>F</kbd>)。
快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd> + <kbd>F</kbd>(或者 <kbd>Command</kbd> + <kbd>F</kbd>)。

| 题号 | 题解 | 标签 | 难度 |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- | ---- |
Expand Down
2 changes: 1 addition & 1 deletion lcs/README.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

列表所有题解均由 [开源社区 Doocs](https://github.com/doocs) 贡献者提供,正在完善中,欢迎贡献你的题解!

快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd>+<kbd>F</kbd>(或者 <kbd>Command</kbd>+<kbd>F</kbd>)。
快速搜索题号、题解、标签等,请善用 <kbd>Control</kbd> + <kbd>F</kbd>(或者 <kbd>Command</kbd> + <kbd>F</kbd>)。

| 题号 | 题解 | 标签 | 难度 | 备注 |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | ---- | ---- |
Expand Down
40 changes: 38 additions & 2 deletions main.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,52 @@ const isEn = () => location.hash.includes('README_EN');

const isRoot = () => ['', '#/', '#/README', '#/README_EN'].includes(location.hash);

const sidebar = () => (isRoot() ? false : isEn() ? 'summary_en.md' : 'summary.md');
const categories = ['javascript', 'database'];

const getSolutionPrefix = url => {
const res = categories.find(
category =>
url.includes(category + '-solution') ||
url.includes(category.toUpperCase() + '_README'),
);
return res ? res + '-' : '';
};

const sidebar = () => {
if (isRoot()) {
return false;
}
const prefix = getSolutionPrefix(location.hash);
return isEn() ? `${prefix}summary_en.md` : `${prefix}summary.md`;
};

const cleanedHtml = html => {
return html.replace(/<pre>([\s\S]*?)<\/pre>/g, (_, group) => {
return '<pre>' + group.replace(/<code>([\s\S]*?)<\/code>/g, '1ドル') + '</pre>';
});
};

const replaceHref = html => {
const prefix = getSolutionPrefix(location.hash);
return prefix ? html.replaceAll('(/solution/', '(/' + prefix + 'solution/') : html;
};

const getLang = () => (isEn() ? 'en' : 'zh-CN');

const giscusTheme = () =>
localStorage.getItem('DARK_LIGHT_THEME') === 'light' ? 'light' : 'noborder_dark';

const getTerm = () => decodeURI(location.hash.slice(1, location.hash.lastIndexOf('/')) || '/index');
const getTerm = () => {
let path = decodeURI(location.hash.slice(1, location.hash.lastIndexOf('/'))) || '/index';
// restore original path
for (const prefix of categories) {
const s = `${prefix}-solution`;
if (path.includes(s)) {
path = path.replace(s, 'solution');
}
}
return path;
};

window.addEventListener('hashchange', () => {
window.$docsify.loadSidebar = sidebar();
Expand All @@ -34,6 +66,9 @@ window.$docsify = {
auto2top: true,
subMaxLevel: 2,
alias: {
'^/javascript-solution/(.*)': '/solution/1ドル',
'^/shell-solution/(.*)': '/solution/1ドル',
'^/database-solution/(.*)': '/solution/1ドル',
'/lcs/.*/summary.md': '/lcs/summary.md',
'/lcp/.*/summary.md': '/lcp/summary.md',
'/lcci/.*/summary.md': '/lcci/summary.md',
Expand Down Expand Up @@ -128,6 +163,7 @@ window.$docsify = {
const github = `[GitHub](${url})`;
const gitee = `[Gitee](${url.replace('github', 'gitee')})`;
html = cleanedHtml(html);
html = replaceHref(html);
const editHtml = isEn()
? `:memo: Edit on ${github} / ${gitee}\n`
: `:memo: 在 ${github} / ${gitee} 编辑\n`;
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /