-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
suspending this project, after realizing that most of the books that I
intended to download and organize at one place would be protected by copyright and it wouldn't be a good thing to get into these troubles. Books in the public domain can still be kept though...`
- Loading branch information
Showing
7 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file removed
BIN
-21.1 MB
...ma_in_programming/Core Java. Volume I 11th Edition - Fundamentals by Horstmann Cay S..pdf
Binary file not shown.
Binary file removed
BIN
-2.19 MB
docs/diploma_in_programming/Effective Java (2017, Addison-Wesley).pdf
Binary file not shown.
Binary file removed
BIN
-99.2 MB
...ldt - Java_ The Complete Reference, Eleventh Edition. 11-McGraw-Hill Education (2019).pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
## Java | ||
# Java | ||
|
||
<!-- https://mozilla.github.io/pdf.js/web/viewer.html?file=https://raw.githubusercontent.com/bsc-iitm/books/master/docs/diploma_in_programming/books_name --> | ||
|
||
- [Concepts in Programming Languages by John C. Mitchell](Concepts in Programming Languages.pdf) | ||
- [Java The Complete Reference Eleventh Edition Paperback by Herbert Schildt]("https://mozilla.github.io/pdf.js/web/viewer.html?file=https://raw.githubusercontent.com/bsc-iitm/books/master/docs/diploma_in_programming/Herbert%20Schildt%20-%20Java_%20The%20Complete%20Reference%2C%20Eleventh%20Edition.%2011-McGraw-Hill%20Education%20(2019).pdf") | ||
## Recommended books | ||
- [Concepts in Programming Languages by John C. Mitchell](https://mozilla.github.io/pdf.js/web/viewer.html?file=https://raw.githubusercontent.com/bsc-iitm/archive/java/Concepts%20in%20Programming%20Languages.pdf) | ||
- [Java The Complete Reference Eleventh Edition Paperback by Herbert Schildt](https://mozilla.github.io/pdf.js/web/viewer.html?file=https://raw.githubusercontent.com/bsc-iitm/books/master/docs/diploma_in_programming/Herbert%20Schildt%20-%20Java_%20The%20Complete%20Reference%2C%20Eleventh%20Edition.%2011-McGraw-Hill%20Education%20(2019).pdf) | ||
- [Effective Java Second Edition Paperback by Joshua Bloch](https://mozilla.github.io/pdf.js/web/viewer.html?file=https://raw.githubusercontent.com/bsc-iitm/books/master/docs/diploma_in_programming/Effective%20Java%20(2017,%20Addison-Wesley).pdf) | ||
- [Core Java - Vol 1 & 2, 11e Paperback by Cay S. Horstmann](https://mozilla.github.io/pdf.js/web/viewer.html?file=https://raw.githubusercontent.com/bsc-iitm/books/master/docs/diploma_in_programming/Core Java. Volume I 11th Edition - Fundamentals by Horstmann Cay S..pdf) | ||
- [Core Java - Vol 1 & 2, 11e Paperback by Cay S. Horstmann](https://mozilla.github.io/pdf.js/web/viewer.html?file=https://raw.githubusercontent.com/bsc-iitm/books/master/docs/diploma_in_programming/Core Java. Volume I 11th Edition - Fundamentals by Horstmann Cay S..pdf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
from typing import List | ||
from urllib.parse import urlparse | ||
|
||
import markdown | ||
from mkdocs.config.defaults import MkDocsConfig | ||
|
||
|
||
class ExternalLinksTreeProcessor(markdown.treeprocessors.Treeprocessor): | ||
""" | ||
Adds target="_blank" and rel="noopener" to external links. | ||
""" | ||
|
||
def __init__(self, md, ignore_domains: List[str]): | ||
super().__init__(md) | ||
# convert to set for faster lookup | ||
self.ignore_domains = set(ignore_domains) | ||
|
||
def run(self, root): | ||
for element in root.iter(): | ||
if element.tag == "a": | ||
href = element.get("href", "") | ||
|
||
# parse the href and check if it's an absolute URL with http or https scheme | ||
parsed_url = urlparse(href) | ||
|
||
if parsed_url.scheme in ["http", "https"]: | ||
# remove port, if present | ||
domain = parsed_url.netloc.split(":")[0] | ||
|
||
# skip if the domain is in the ignore list | ||
if domain in self.ignore_domains: | ||
continue | ||
|
||
element.set("target", "_blank") | ||
element.set("rel", "noopener") | ||
|
||
|
||
class ExternalLinksExtension(markdown.Extension): | ||
def __init__(self, **kwargs): | ||
self.config = { | ||
"ignore_domains": [[], "List of domains to ignore"], | ||
} | ||
super(ExternalLinksExtension, self).__init__(**kwargs) | ||
|
||
def extendMarkdown(self, md: markdown.Markdown): | ||
ignore_domains = self.getConfig("ignore_domains", []) | ||
if not isinstance(ignore_domains, list): | ||
raise ValueError("'ignore_domains' config must be a list") | ||
|
||
md.treeprocessors.register( | ||
ExternalLinksTreeProcessor(md, ignore_domains), "external_links", -1000 | ||
) | ||
|
||
|
||
def on_config(config: MkDocsConfig, **kwargs): | ||
# a list of domains to ignore | ||
# WARNING: requires re-running `mkdocs serve` when changed | ||
IGNORE_DOMAINS = ["example.com"] | ||
|
||
# inject the markdown extension | ||
config.markdown_extensions.append( | ||
ExternalLinksExtension(ignore_domains=IGNORE_DOMAINS) | ||
) | ||
return config |