@@ -43,25 +43,33 @@ class RESOURCES {
4343
4444 static links = [
4545 'https://raw.githubusercontent.com/MicrosoftDocs/{repo}/{branch}/' ,
46- 'https://cdn.jsdelivr.net/gh/MicrosoftDocs/{repo}@{branch}/docs/' ,
46+ 'https://gitee.com/dosasm/{repo}/raw/{branch}/' ,
47+ 'https://cdn.jsdelivr.net/gh/MicrosoftDocs/{repo}@{branch}/' ,
4748 ] ;
4849
49- static getlinks ( id : string , lang : string ) : string [ ] {
50+ /**get links from the cpp-docs id
51+ * The Microsoft has removed its localized docs repo from github
52+ * TODO: find a way to get the content of localized docs
53+ * see: https://github.com/MicrosoftDocs/cpp-docs
54+ * @param id
55+ * @param lang
56+ * @returns links for download
57+ */
58+ static getlinks ( id : string , lang : string , prefix = 'docs/assembler/masm/' ) : string [ ] {
5059 const links = [ ...RESOURCES . links ] ;
51- if ( lang === 'zh-cn' ) {
52- links . unshift ( 'https://gitee.com/dosasm/cpp-docs.zh-cn/raw/live/' ) ;
53- }
54- let repoName = 'cpp-docs' ;
55- const pre = 'docs/assembler/masm/' ;
56- let branchName = 'master' ;
57- if ( lang && Object . keys ( RESOURCES . langMap ) . includes ( lang ) ) {
58- repoName += `.${ RESOURCES . langMap [ lang ] } ` ;
59- branchName = 'live' ;
60- }
61- return links . map (
60+
61+ // if (lang === 'zh-cn') {
62+ // links = ['https://gitee.com/dosasm/cpp-docs.zh-cn/raw/live/'];
63+ // }
64+
65+ const repoName = 'cpp-docs' ;
66+ const branchName = 'master' ;
67+ const downloadables = links . map (
6268 val => val . replace ( '{repo}' , repoName )
63- . replace ( '{branch}' , branchName ) + pre + id + '.md'
69+ . replace ( '{branch}' , branchName ) + prefix + id + '.md'
6470 ) ;
71+
72+ return downloadables ;
6573 }
6674
6775 static generateFromCppdoc ( text : string ) : CppdocInfoCollection {
0 commit comments