Skip to content
Open
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
Binary file added docs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 19 additions & 11 deletions src/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
function Home() {
return (
<div>
<h1>Mathdownへようこそ</h1>
<ul>
<li>
<a href="/App">アプリを開く</a>
</li>
<li>
<a href="/UserGuide/1">使い方</a>
</li>
</ul>
</div>
<>
<div
className="App">
<a href="/home">
<img src="../docs/logo.png" width="12.5%" height="12.5%" />
</a>
</div>
<div>
<h1>Mathdownへようこそ</h1>
<ul>
<li>
<a href="/App">アプリを開く</a>
</li>
<li>
<a href="/UserGuide/1">使い方</a>
</li>
</ul>
</div>
</>
);
}

Expand Down
8 changes: 8 additions & 0 deletions src/UserGuide/UserGuide.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
function UserGuide() {
return (
<>
<div
className="App">
<a href="/home">
<img src="../docs/logo.png" width="12.5%" height="12.5%"/>
</a>
</div>
<div>
<h1>使い方</h1>
<p>
<a href="/UserGuide/1">{"<"}</a>1/2<a href="/UserGuide/2">{">"}</a>
</p>
</div>
</>
);
}

Expand Down
20 changes: 14 additions & 6 deletions src/UserGuide/UserGuide_2.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
function UserGuide_2() {
return (
<div>
<h1>使い方</h1>
<p>
<a href="/UserGuide/1">{"<"}</a>2/2<a href="/UserGuide/1">{">"}</a>
</p>
</div>
<>
<div
className="App">
<a href="/home">
<img src="../docs/logo.png" width="12.5%" height="12.5%" />
</a>
</div>
<div>
<h1>使い方</h1>
<p>
<a href="/UserGuide/1">{"<"}</a>2/2<a href="/UserGuide/1">{">"}</a>
</p>
</div>
</>
);
}

Expand Down
6 changes: 6 additions & 0 deletions src/extractPDF.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import Textarea from "@mui/joy/Textarea";

type optsObject = { prefix: string; suffix: string };
type pdfType = { numPages: number; getPage: (arg0: number) => any }; // React-pdfで取得されるPDFには、合計ページ数を指す`numPage`属性と、それぞれのページの(文字列などの)情報を含む`getPages`を含む。

Check warning on line 25 in src/extractPDF.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

Unexpected any. Specify a different type
// 使用法
// const page = await pdf.getPage(5); // 5ページ目の情報取得
// const textContent = await page.getTextContent(); // getTextContent属性で文字列取得。
Expand All @@ -41,7 +41,7 @@
const [explanation, setExplanation] = useState<string>(""); // ユーザー入力の部分。今は暫定的にテキストエリアを置いている。

const array: number[] = [1, 2, 3, 4, 5, 6, 7, 8];
const reactArray: any = array.map((index) => {

Check warning on line 44 in src/extractPDF.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

Unexpected any. Specify a different type
// ページ数をどうにか見える化したい。
return (
<Page
Expand Down Expand Up @@ -77,7 +77,7 @@

// pdfから文字を抜き出す非同期関数
async function extractTextFromPDF(pdf: pdfType) {
const resultContent: any[] = [];

Check warning on line 80 in src/extractPDF.tsx

View workflow job for this annotation

GitHub Actions / Lint (ESLint)

Unexpected any. Specify a different type
const getPageText = async (pageNum: number) => {
const page = await pdf.getPage(pageNum);
const textContent = await page.getTextContent(); // console.log(textContent.items); をしてみると良い。
Expand Down Expand Up @@ -111,6 +111,12 @@

return (
<>
<div
className="App">
<a href="/home">
<img src="../docs/logo.png" width="12.5%" height="12.5%"/>
</a>
</div>
<h2>PDFの解説表示</h2>
<div className="flex">
<div className="explanation">
Expand Down
Loading