Skip to content

Commit

Permalink
Revert "Merge branch 'main' into cite-box"
Browse files Browse the repository at this point in the history
This reverts commit 4c5eeb0, reversing
changes made to 9d064a9.
  • Loading branch information
ElenaKrippner committed Dec 11, 2023
1 parent 4c5eeb0 commit 2746775
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 689 deletions.
8 changes: 0 additions & 8 deletions cli/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ pub fn compile(config: Config) -> Result<(), GeneralError> {
&out_path,
OutputFormatKind::Html.extension(),
)?,
OutputFormatKind::Umi => write_file(
&um.render_umi()
.map_err(|_| GeneralError::Render)?
.create_workbook()
.to_string(),
&out_path,
OutputFormatKind::Umi.extension(),
)?,
}
}

Expand Down
Binary file removed cli/tests/test_files/supported.umi
Binary file not shown.
31 changes: 0 additions & 31 deletions cli/tests/umi.rs

This file was deleted.

3 changes: 0 additions & 3 deletions commons/src/config/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ impl ConfigFns for Output {
pub enum OutputFormatKind {
#[default]
Html,
Umi,
}

impl OutputFormatKind {
/// Returns the associated file extension for an output format.
pub fn extension(&self) -> &str {
match self {
OutputFormatKind::Html => "html",
OutputFormatKind::Umi => "umi",
}
}
}
Expand All @@ -89,7 +87,6 @@ impl FromStr for OutputFormatKind {
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.to_lowercase().as_str() {
"html" => Ok(OutputFormatKind::Html),
"umi" => Ok(OutputFormatKind::Umi),
o => Err(format!("Bad output format: {}", o)),
}
}
Expand Down
10 changes: 3 additions & 7 deletions commons/src/config/preamble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,11 @@ impl ConfigFns for Preamble {
}
}

pub fn default_locale() -> Locale {
icu_locid::locale!("en")
}

#[derive(Args, Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct I18n {
#[arg(long, value_parser = locale::clap::parse_locale, default_value = "en")]
#[serde(with = "locale::serde::single", default = "self::default_locale")]
pub lang: Locale,
#[arg(long, value_parser = locale::clap::parse_locale)]
#[serde(with = "locale::serde::optional", default)]
pub lang: Option<Locale>,

#[arg(long, value_parser = parse_to_hashset::<Locale>, required = false, default_value = "")]
#[serde(with = "locale::serde::multiple", default)]
Expand Down
4 changes: 1 addition & 3 deletions commons/src/lexer/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

use std::ops::{Add, AddAssign, Sub, SubAssign};

use serde::{Deserialize, Serialize};

use super::span::SpanLen;

/// Indicates position of a symbol or token in a Unimarkup document. Both line and column
/// counting starts from 1.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Position {
/// Line the symbol or token is found at
pub line: usize,
Expand Down
6 changes: 0 additions & 6 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ use crate::render::html::render::HtmlRenderer;
use crate::render::html::Html;
use crate::render::log_id::RenderError;
use crate::render::render::{OutputFormat, Renderer};
use crate::render::umi::render::UmiRenderer;
use crate::render::umi::Umi;

pub struct Unimarkup {
doc: Document,
Expand Down Expand Up @@ -45,8 +43,4 @@ impl Unimarkup {
pub fn render_html(&self) -> Result<Html, RenderError> {
self.render(HtmlRenderer::default())
}

pub fn render_umi(&self) -> Result<Umi, RenderError> {
self.render(UmiRenderer::default())
}
}
12 changes: 6 additions & 6 deletions parser/src/elements/atomic/heading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ impl HeadingLevel {
/// The `str` representation of the [`HeadingLevel`].
pub fn as_str(&self) -> &'static str {
match self {
HeadingLevel::Level1 => "#",
HeadingLevel::Level2 => "##",
HeadingLevel::Level3 => "###",
HeadingLevel::Level4 => "####",
HeadingLevel::Level5 => "#####",
HeadingLevel::Level6 => "######",
HeadingLevel::Level1 => "# ",
HeadingLevel::Level2 => "## ",
HeadingLevel::Level3 => "### ",
HeadingLevel::Level4 => "#### ",
HeadingLevel::Level5 => "##### ",
HeadingLevel::Level6 => "###### ",
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ unimarkup-inline = { path = "../inline/", version = "0" }
unimarkup-parser = { path = "../parser/", version = "0" }
syntect = "5.0"
rustyscript = "0.1.1"
spreadsheet-ods = "0.17.0"
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
1 change: 0 additions & 1 deletion render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ mod csl_json;
pub mod html;
pub mod log_id;
pub mod render;
pub mod umi;
5 changes: 0 additions & 5 deletions render/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::html::citeproc::CiteprocWrapper;
use logid::log;
use serde_json::Value;
use std::path::PathBuf;
use unimarkup_commons::config::Config;
use unimarkup_commons::{
config::icu_locid::{locale, Locale},
lexer::span::Span,
Expand Down Expand Up @@ -139,10 +138,6 @@ impl<'a> Context<'a> {
bibliography,
}
}

pub fn get_config(&self) -> &Config {
&self.doc.config
}
}

pub fn render<T: OutputFormat>(
Expand Down
Loading

0 comments on commit 2746775

Please sign in to comment.