[go: up one dir, main page]

Skip to content
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

Better export to epub #1144

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
reorganized export to epub filestructure
  • Loading branch information
CD-Z committed Jul 27, 2024
commit ba1ceea58e5ceb3342c20e79c5c908710b05716a
2 changes: 1 addition & 1 deletion packages/@cd-z/epub-constructor
Submodule epub-constructor updated from 46b946 to dd867a
2 changes: 1 addition & 1 deletion packages/@cd-z/react-native-epub-creator
Submodule react-native-epub-creator updated from ba37f0 to b3b9c6
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { NOVEL_STORAGE } from '@utils/Storages';
import FileManager from '@native/FileManager';
import color from 'color';
//@ts-ignore
import css from './../../../../android/app/src/main/assets/css/index';
import css from '../../../../../android/app/src/main/assets/css/index';
// import style from './index.css';

interface ExportEpubModalProps {
Expand Down Expand Up @@ -43,33 +43,30 @@ const ExportEpubModal: React.FC<ExportEpubModalProps> = ({
`${
epubUseAppTheme
? `
:root {
--StatusBar-currentHeight: ${StatusBar.currentHeight};
--readerSettings-theme: ${readerSettings.theme};
--readerSettings-padding: ${readerSettings.padding}%;
--readerSettings-textSize: ${
readerSettings.textSize / 10
}rem;
--readerSettings-textColor: ${readerSettings.textColor};
--readerSettings-textAlign: ${readerSettings.textAlign};
--readerSettings-lineHeight: ${readerSettings.lineHeight};
--readerSettings-fontFamily: ${readerSettings.fontFamily};
--theme-primary: ${theme.primary};
--theme-onPrimary: ${theme.onPrimary};
--theme-secondary: ${theme.secondary};
--theme-tertiary: ${theme.tertiary};
--theme-onTertiary: ${theme.onTertiary};
--theme-onSecondary: ${theme.onSecondary};
--theme-surface: ${theme.surface};
--theme-surface-0-9: ${color(theme.surface)
.alpha(0.9)
.toString()};
--theme-onSurface: ${theme.onSurface};
--theme-surfaceVariant: ${theme.surfaceVariant};
--theme-onSurfaceVariant: ${theme.onSurfaceVariant};
--theme-outline: ${theme.outline};
--theme-rippleColor: ${theme.rippleColor};
}
:root {
--StatusBar-currentHeight: ${StatusBar.currentHeight};
--readerSettings-theme: ${readerSettings.theme};
--readerSettings-padding: ${readerSettings.padding}%;
--readerSettings-textSize: ${readerSettings.textSize / 10}rem;
--readerSettings-textColor: ${readerSettings.textColor};
--readerSettings-textAlign: ${readerSettings.textAlign};
--readerSettings-lineHeight: ${readerSettings.lineHeight}rem;
--theme-primary: ${theme.primary};
--theme-onPrimary: ${theme.onPrimary};
--theme-secondary: ${theme.secondary};
--theme-tertiary: ${theme.tertiary};
--theme-onTertiary: ${theme.onTertiary};
--theme-onSecondary: ${theme.onSecondary};
--theme-surface: ${theme.surface};
--theme-surface-0-9: ${color(theme.surface)
.alpha(0.9)
.toString()};
--theme-onSurface: ${theme.onSurface};
--theme-surfaceVariant: ${theme.surfaceVariant};
--theme-onSurfaceVariant: ${theme.onSurfaceVariant};
--theme-outline: ${theme.outline};
--theme-rippleColor: ${theme.rippleColor};
}
` + css
: ''
}
Expand Down Expand Up @@ -103,6 +100,7 @@ const ExportEpubModal: React.FC<ExportEpubModalProps> = ({
`,
[novel, readerSettings],
);
console.log(novel.cover);

const createEpub = async (uri: string) => {
var epub = new EpubBuilder(
Expand Down Expand Up @@ -132,7 +130,7 @@ const ExportEpubModal: React.FC<ExportEpubModalProps> = ({
title:
chapter.name?.trim() ?? 'Chapter ' + (chapter.chapterNumber || i),
fileName: 'Chapter' + i,
htmlBody: `<chapter data-novel-id='${novel.pluginId}' data-chapter-id='${chapter.id}'>${downloaded}</chapter>`,
htmlBody: `<div data-plugin-id='${novel.pluginId}' data-novel-id='${chapter.novelId}' data-chapter-id='${chapter.id}'>${downloaded}</div>`,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/novel/components/NovelAppbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Animated, {
interpolateColor,
useAnimatedStyle,
} from 'react-native-reanimated';
import ExportEpubModal from './ExportEpubModal';
import ExportEpubModal from './ExportToEpub/ExportEpubModal';
import { ChapterInfo, NovelInfo } from '@database/types';
import { useBoolean } from '@hooks/index';

Expand Down