Skip to content

Commit

Permalink
refactor: remove injection code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kremilly committed Jun 10, 2024
1 parent cd08157 commit 50f6d8c
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 74 deletions.
7 changes: 0 additions & 7 deletions scimon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,3 @@ render_markdown:
overwrite: true # Boolean (valid values: 'true' or 'false'; default: 'true')
mode: 'scimon' # String (valid values: 'scimon' and 'pure'; default: 'scimon')
minify_html: true # Boolean (valid values: 'true' or 'false'; default: 'true')
minify_extra_plugins: true # Boolean (valid values: 'true' or 'false'; default: 'true')

load_js_cdn: # List
- 'https://cdn.jsdelivr.net/npm/citation-js'
- 'https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-mml-chtml.min.js'
- 'https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.9.0/mermaid.min.js'
- 'https://addons.scibun.com/static/prism.js'
2 changes: 0 additions & 2 deletions src/prime_down/inject/mod.rs

This file was deleted.

45 changes: 0 additions & 45 deletions src/prime_down/inject/pd_inject_js.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/prime_down/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub mod pd_io;
pub mod pd_core;

// Helpers
pub mod inject;
pub mod pd_inject;

// Extras
pub mod pd_extras;
2 changes: 1 addition & 1 deletion src/prime_down/pd_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use headless_chrome::{
use crate::{
consts::uris::Uris,
configs::settings::Settings,
prime_down::inject::pd_inject::PrimeDownInject,
prime_down::pd_inject::PrimeDownInject,

utils::{
base64::Base64,
Expand Down
18 changes: 0 additions & 18 deletions src/prime_down/inject/pd_inject.rs → src/prime_down/pd_inject.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
use serde_yaml::Value;

use crate::{
utils::str::StrUtils,
configs::settings::Settings,
prime_down::inject::pd_inject_js::PrimeDownInjectJS,

consts::{
uris::Uris,
Expand All @@ -15,19 +11,7 @@ pub struct PrimeDownInject;

impl PrimeDownInject {

fn get_js(render_mode: Value) -> String {
let cdn = if render_mode == Global::APP_NAME {
PrimeDownInjectJS::load_from_cdn()
} else {
"".to_string()
};

format!("{}", cdn)
}

pub fn content(file: &str, contents: String, markdown_html: String) -> String {
let render_mode = Settings::get("render_markdown.mode", "STRING");

let title = format!(
"{}: {}: README", StrUtils::capitalize(&Global::APP_NAME), &file.replace(
".md", ""
Expand All @@ -45,8 +29,6 @@ impl PrimeDownInject {
"{{ dist_bundle_js }}", &bundle_js_link
).replace(
"{{ markdown_content }}", &markdown_html
).replace(
"{{ inject_js }}", &Self::get_js(render_mode)
)
}

Expand Down

0 comments on commit 50f6d8c

Please sign in to comment.