Browse Source

注释测试数据

main
pd 5 days ago
parent
commit
8bf4d02d1f
  1. 44
      deepsearcher/templates/html/index.html

44
deepsearcher/templates/html/index.html

@ -174,7 +174,7 @@
</div> </div>
</div> </div>
<div class="card"> <!-- <div class="card">
<div <div
class="query-result markdown-body" class="query-result markdown-body"
id="test" id="test"
@ -226,7 +226,7 @@
下载 下载
</button> </button>
</div> </div>
</div> </div> -->
</main> </main>
<footer> <footer>
@ -236,29 +236,29 @@
<script src="../static/js/app.js"></script> <script src="../static/js/app.js"></script>
<script> <script>
fetch('../static/data/test.txt').then((res) => { // fetch('../static/data/test.txt').then((res) => {
res.text().then((text) => { // res.text().then((text) => {
document.getElementById('test').innerHTML = md.render(text); // document.getElementById('test').innerHTML = md.render(text);
}); // });
}); // });
function downloadPdf1() { // function downloadPdf1() {
const element = document.getElementById('test'); // const element = document.getElementById('test');
const opt = { // const opt = {
margin: 12, // margin: 12,
filename: '内容.pdf', // filename: '内容.pdf',
image: { type: 'jpeg', quality: 0.98 }, // image: { type: 'jpeg', quality: 0.98 },
enableLinks: true, // enableLinks: true,
html2canvas: { scale: 2, logging: true, useCORS: true }, // 提高清晰度 // html2canvas: { scale: 2, logging: true, useCORS: true }, // 提高清晰度
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }, // jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
pagebreak: { // pagebreak: {
mode: ['avoid-all', 'css', 'legacy'] // mode: ['avoid-all', 'css', 'legacy']
} // }
}; // };
html2pdf().set(opt).from(element).save(); // html2pdf().set(opt).from(element).save();
} // }
function changeTheme(url) { function changeTheme(url) {
document.getElementById('md-theme').setAttribute('href', url); document.getElementById('md-theme').setAttribute('href', url);

Loading…
Cancel
Save