Skip to content

[chore] make it possible to disable pandoc #918

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions flake-info/src/data/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};

use super::{
import::{self, DocString, DocValue, ModulePath, NixOption},
pandoc::PandocExt,
//pandoc::PandocExt,
utility::{Flatten, OneOrMany},
};

Expand Down Expand Up @@ -127,7 +127,7 @@ impl TryFrom<(import::FlakeEntry, super::Flake)> for Derivation {
})
.into();

let long_description = long_description.map(|s| s.render_markdown()).transpose()?;
let long_description = Some(String::new()); //long_description.map(|s| s.render_markdown()).transpose()?;

let package_license: Vec<License> = license
.map(OneOrMany::into_list)
Expand Down Expand Up @@ -233,11 +233,11 @@ impl TryFrom<import::NixpkgsEntry> for Derivation {
.flat_map(|m| m.name.to_owned())
.collect();

let long_description = package
.meta
.long_description
.map(|s| s.render_markdown())
.transpose()?;
let long_description = Some(String::new()); //package
//.meta
//.long_description
//.map(|s| s.render_markdown())
//.transpose()?;

let position: Option<String> = package.meta.position.map(|p| {
if p.starts_with("/nix/store") {
Expand Down
17 changes: 4 additions & 13 deletions flake-info/src/data/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use serde::de::{self, MapAccess, Visitor};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_json::Value;

use super::pandoc::PandocExt;
//use super::pandoc::PandocExt;
use super::prettyprint::print_value;
use super::utility::{Flatten, OneOrMany};

Expand Down Expand Up @@ -118,10 +118,7 @@ impl Serialize for DocString {
{
match self {
DocString::String(md) | DocString::DocFormat(DocFormat::MarkdownDoc(md)) => serializer
.serialize_str(&md.render_markdown().unwrap_or_else(|e| {
warn!("Could not render Markdown content: {}", e);
md.to_owned()
})),
.serialize_str("ok"),
}
}
}
Expand All @@ -134,16 +131,10 @@ impl Serialize for DocValue {
match self {
DocValue::Literal(Literal::LiteralExpression(s)) => serializer.serialize_str(&s),
DocValue::Literal(Literal::LiteralDocBook(db)) => {
serializer.serialize_str(&db.render_docbook().unwrap_or_else(|e| {
warn!("Could not render DocBook content: {}", e);
db.to_owned()
}))
serializer.serialize_str("ok")
}
DocValue::Literal(Literal::LiteralMarkdown(md)) => {
serializer.serialize_str(&md.render_markdown().unwrap_or_else(|e| {
warn!("Could not render Markdown content: {}", e);
md.to_owned()
}))
serializer.serialize_str("ok")
}
DocValue::Value(v) => serializer.serialize_str(&print_value(v)),
}
Expand Down