├── .gitignore
├── LICENSE
├── README.md
├── markdowneditor
├── markdowneditor.pro
├── markdowneditor.rc
├── qmls
│ ├── base.qrc
│ ├── custom
│ │ ├── FileTree
│ │ │ ├── FileTreeRightMenu.qml
│ │ │ ├── FileTreeViewStyle.qml
│ │ │ └── SubTree.qml
│ │ ├── MarkdownEditor.qml
│ │ ├── MarkdownViewer.qml
│ │ ├── SettingsItem.qml
│ │ ├── items
│ │ │ └── ImageButton.qml
│ │ ├── navigationbar
│ │ │ ├── TitleNavigationBar.qml
│ │ │ └── TitleNavigationItem.qml
│ │ └── partition
│ │ │ ├── DragLine.qml
│ │ │ └── Triangle.qml
│ └── main.qml
├── resources
│ ├── 3rdparty
│ │ ├── markdown.css
│ │ ├── markdown.css.save
│ │ ├── marked.min.js
│ │ └── simple-markdown.css
│ ├── default.md
│ ├── images.qrc
│ ├── images
│ │ ├── 32x32
│ │ │ ├── markdown-editor-logo.ico
│ │ │ └── markdown-editor-logo.png
│ │ └── svg
│ │ │ ├── add.svg
│ │ │ ├── delete.svg
│ │ │ ├── dir.svg
│ │ │ ├── dir_open.svg
│ │ │ ├── doc.svg
│ │ │ ├── doc_null.svg
│ │ │ ├── file-markdown.svg
│ │ │ ├── max.svg
│ │ │ ├── min.svg
│ │ │ ├── point.svg
│ │ │ ├── sets
│ │ │ ├── edit.svg
│ │ │ ├── edit_view.svg
│ │ │ ├── file_list.svg
│ │ │ ├── look.svg
│ │ │ ├── set_hollow.svg
│ │ │ └── set_solid.svg
│ │ │ ├── triangle_down.svg
│ │ │ └── triangle_right.svg
│ ├── index.html
│ ├── markdown-it
│ │ ├── markdown-it-footnote.js
│ │ ├── markdown-it-math.js
│ │ ├── markdown-it.js
│ │ └── mathjax.css
│ ├── markdowneditor.qrc
│ └── qwebchannel.js
└── src
│ ├── document.cpp
│ ├── document.h
│ ├── dragarea.cpp
│ ├── dragarea.h
│ ├── filemodel.cpp
│ ├── filemodel.h
│ ├── main.cpp
│ ├── utils.cpp
│ └── utils.h
└── screenShot
└── home.png
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pro.user*
2 | */output
3 | build-markdowneditor-*
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # markdown-editor
2 | A qml markdown editor
3 |
4 | download [releases](https://github.com/CrazyCxl/markdown-editor/releases)
5 |
6 | 
7 |
8 | # Todo list
9 |
10 | - Syntax highlighting
11 | - The chart support
12 |
13 | # Reference
14 | - [github-markdown-css](https://github.com/sindresorhus/github-markdown-css)
15 | - [Moeditor](https://github.com/Moeditor/Moeditor)
16 | - [qtwebengine-webenginewidgets-markdowneditor-example](https://doc.qt.io/qt-5.10/qtwebengine-webenginewidgets-markdowneditor-example.html)
17 | - [mathml css](https://github.com/fred-wang/mathml.css)
18 | - [markdown it](https://github.com/markdown-it/markdown-it)
19 | - [markdown it math](https://github.com/runarberg/markdown-it-math)
20 | - [markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote)
21 |
--------------------------------------------------------------------------------
/markdowneditor/markdowneditor.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = app
2 | DESTDIR = $$PWD/bin
3 | PROJECT_DIR = $$[DESTDIR]
4 |
5 | QT += webenginewidgets webchannel qml quick webengine
6 | CONFIG += c++11
7 |
8 | HEADERS += \
9 | src/document.h \
10 | src/filemodel.h \
11 | src/utils.h \
12 | src/dragarea.h
13 |
14 | SOURCES = \
15 | src/main.cpp \
16 | src/document.cpp \
17 | src/filemodel.cpp \
18 | src/utils.cpp \
19 | src/dragarea.cpp
20 |
21 | RESOURCES = \
22 | resources/markdowneditor.qrc \
23 | resources/images.qrc \
24 | qmls/base.qrc
25 |
26 | FORMS +=
27 |
28 | DISTFILES += \
29 | resources/3rdparty/MARKDOWN-LICENSE.txt \
30 | resources/3rdparty/MARKED-LICENSE.txt
31 |
32 | # Copies the given files to the destination directory
33 | defineTest(CopyToDestDir) {
34 | files = $$1
35 |
36 | for(FILE, files) {
37 | DDIR = $$DESTDIR
38 |
39 | # Replace slashes in paths with backslashes for Windows
40 | win32:FILE ~= s,/,\\,g
41 | win32:DDIR ~= s,/,\\,g
42 |
43 | QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t)
44 | }
45 |
46 | export(QMAKE_POST_LINK)
47 | }
48 |
49 | CONFIG(debug, debug|release){
50 | CONFIG += console
51 | DESTDIR = $$PWD/output/debug
52 | }
53 |
54 | CONFIG(release, debug|release){
55 | CONFIG -= app_bundle
56 | CONFIG -= console
57 | DESTDIR = $$PWD/output/release
58 | }
59 |
60 | QML_IMPORT_PATH = $$[QT_INSTALL_QML]
61 |
62 | win32 {
63 | RC_FILE = markdowneditor.rc
64 | }
65 |
66 | mqmls = $$PWD/qmls/main.qml \
67 | $$PWD/qmls/custom/partition/DragLine.qml \
68 | $$PWD/qmls/custom/partition/Triangle.qml \
69 | $$PWD/qmls/custom/MarkdownViewer.qml \
70 | $$PWD/qmls/custom/MarkdownEditor.qml \
71 | $$PWD/qmls/custom/FileTree/SubTree.qml \
72 | $$PWD/qmls/custom/FileTree/FileTreeViewStyle.qml \
73 | $$PWD/qmls/custom/FileTree/FileTreeRightMenu.qml \
74 | $$PWD/qmls/custom/SettingsItem.qml \
75 | $$PWD/qmls/custom/items/ImageButton.qml \
76 | $$PWD/qmls/custom/navigationbar/TitleNavigationBar.qml \
77 | $$PWD/qmls/custom/navigationbar/TitleNavigationItem.qml
78 |
79 | qml_scenes.depends = $$mqmls
80 | qml_scenes.commands =
81 | QMAKE_EXTRA_TARGETS += qml_scenes
82 |
83 | # install
84 | target.path = $$PWD/bin
85 | plugins_platforms.path = $$PWD/bin/platforms
86 |
87 | INSTALLS += target
88 | INSTALLS += plugins_platforms
89 |
90 |
--------------------------------------------------------------------------------
/markdowneditor/markdowneditor.rc:
--------------------------------------------------------------------------------
1 | #include "winver.h"
2 | IDI_ICON1 ICON "./resources/images/32x32/markdown-editor-logo.ico"
3 |
4 | #define VERSION_1 0
5 | #define VERSION_2 0
6 | #define VERSION_3 1
7 |
8 | VS_VERSION_INFO VERSIONINFO
9 | FILEVERSION VERSION_1,VERSION_2,VERSION_3
10 | PRODUCTVERSION VERSION_1,VERSION_2,VERSION_3
11 | FILEFLAGS 0x0L
12 | FILEFLAGSMASK 0x3fL
13 | FILEOS 0x40004L
14 | FILETYPE 0x1L
15 | FILESUBTYPE 0x0L
16 | BEGIN
17 | BLOCK "StringFileInfo"
18 | BEGIN
19 | BLOCK "080404b0"
20 | BEGIN
21 | VALUE "CompanyName", "Chengdu cxl."
22 | VALUE "FileDescription", "Cxl Markdown Editor"
23 | VALUE "FileVersion", VERSION_1"." VERSION_2"." VERSION_3
24 | VALUE "LegalCopyright", "Copyright 2018-2019 The Chengdu Cxl. All rights reserved."
25 | VALUE "InternalName", "markdowneditor.exe"
26 | VALUE "OriginalFilename", "markdowneditor.exe"
27 | VALUE "ProductName", "Cxl Markdown Editor"
28 | VALUE "ProductVersion", VERSION_1"." VERSION_2"." VERSION_3
29 | END
30 | END
31 | BLOCK "VarFileInfo"
32 | BEGIN
33 | VALUE "Translation", 0x804, 1200
34 | END
35 | END
36 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/base.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | main.qml
4 | custom/MarkdownViewer.qml
5 | custom/MarkdownEditor.qml
6 | custom/SettingsItem.qml
7 | custom/items/ImageButton.qml
8 | custom/navigationbar/TitleNavigationBar.qml
9 | custom/navigationbar/TitleNavigationItem.qml
10 | custom/FileTree/SubTree.qml
11 | custom/FileTree/FileTreeViewStyle.qml
12 | custom/FileTree/FileTreeRightMenu.qml
13 | custom/partition/DragLine.qml
14 | custom/partition/Triangle.qml
15 |
16 |
17 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/FileTree/FileTreeRightMenu.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 | import QtQuick.Controls 2.2
3 | import cxl.normal 1.0
4 |
5 | Menu{
6 | property var selectFileIndex
7 | property bool isDir: false
8 | property bool isDirExpanded: false
9 | property bool isSpaceClick: false
10 | MenuItem{
11 | text: isDir? (isDirExpanded ? qsTr("Fold") : qsTr("Expanded") ): qsTr("Open")
12 | visible:!isSpaceClick
13 | height:visible?implicitHeight :0
14 | onTriggered: {
15 | if(isDir){
16 | if(isDirExpanded){
17 | view.collapse(selectFileIndex)
18 | }else{
19 | view.expand(selectFileIndex)
20 | }
21 | }else{
22 | file_view.selectTitle = fileMode.data(selectFileIndex, FileModel.BaseNameStringRole)
23 | file_view.pathSelected(fileMode.data(selectFileIndex, FileModel.UrlStringRole))
24 | }
25 | }
26 | }
27 |
28 | MenuItem{
29 | text: qsTr("Open the folder")
30 | visible:!isSpaceClick
31 | height:visible?implicitHeight :0
32 | onTriggered: {
33 | var url = fileMode.data(selectFileIndex, FileModel.DirStringRole)
34 | Qt.openUrlExternally(url)
35 | }
36 | }
37 |
38 | MenuItem{
39 | text: qsTr("Set working folders")
40 | visible:isSpaceClick
41 | height:visible?implicitHeight :0
42 | onTriggered: {
43 | file_view.showChangeDirDialog()
44 | }
45 | }
46 |
47 | function reload(index){
48 | selectFileIndex = index
49 | if(fileMode.data(index, FileModel.IsValidRole)){
50 | isSpaceClick = false
51 | if(!fileMode.data(index, FileModel.IsDirRole)){
52 | isDir = false
53 | }else{
54 | isDir = true
55 | isDirExpanded = view.isExpanded(index)
56 | }
57 | }else{
58 | isSpaceClick = true
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/FileTree/FileTreeViewStyle.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 | import QtQuick.Controls.Styles 1.4
3 | import cxl.normal 1.0
4 |
5 | TreeViewStyle {
6 | frame:null
7 | branchDelegate: Image {
8 | width: 14
9 | height: width
10 | source:styleData.isExpanded ? "qrc:/item/images/svg/triangle_down.svg" : "qrc:/item/images/svg/triangle_right.svg"
11 | }
12 |
13 | itemDelegate: Item {
14 | Image {
15 | id: doc_type_image
16 | anchors.left: parent.left
17 | anchors.leftMargin: 3
18 | anchors.verticalCenter: parent.verticalCenter
19 | width: 15
20 | height: width
21 | source: styleData.hasChildren?
22 | (styleData.isExpanded?"qrc:/item/images/svg/dir_open.svg":"qrc:/item/images/svg/dir.svg"):
23 | (fileMode.data(styleData.index, FileModel.IsMarkdownFileRole)?"qrc:/item/images/svg/file-markdown.svg":
24 | "qrc:/item/images/svg/doc_null.svg")
25 | }
26 |
27 | Text {
28 | anchors.left: doc_type_image.right
29 | anchors.leftMargin: 5
30 | anchors.verticalCenter: parent.verticalCenter
31 | anchors.right: parent.right
32 | elide: Text.ElideMiddle
33 | text: styleData.value
34 | }
35 | }
36 |
37 | rowDelegate:Rectangle{
38 | height: 25
39 | color: styleData.selected?"#efefef":"#ffffff"
40 | }
41 |
42 | handle: Rectangle {
43 | implicitWidth: 10
44 | color: styleData.hovered?"#c0c0c0":"#e0e0e0"
45 | }
46 |
47 | scrollBarBackground: Rectangle {
48 | implicitWidth: 10
49 | color: "#f5f5f5"
50 | }
51 | decrementControl: null
52 | incrementControl: null
53 | }
54 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/FileTree/SubTree.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.4
2 | import QtQuick.Controls 1.4
3 | import QtQml.Models 2.2
4 | import QtQuick.Dialogs 1.0
5 | import cxl.normal 1.0
6 |
7 | Rectangle {
8 | color:"#ffffff"
9 |
10 | property string selectTitle
11 | property string dirPath
12 | property var fileMode
13 | property bool enableChangeDir: false
14 |
15 | signal pathSelected(var path)
16 |
17 | function showChangeDirDialog(){
18 | if(enableChangeDir){
19 | fileDialog.visible = true
20 | }
21 | }
22 |
23 | Rectangle{
24 | id:top_item
25 | anchors.top: parent.top
26 | width: parent.width
27 | height: 30
28 | visible: false
29 | Text {
30 | id:text_field
31 | anchors.centerIn: parent
32 | width: parent.width-20
33 | text: fileMode.dirPath
34 | elide: Text.ElideMiddle
35 | color:top_area.containsMouse?"#202020":"#000000"
36 | }
37 |
38 | MouseArea{
39 | id:top_area
40 | anchors.fill: parent
41 | hoverEnabled: true
42 | onClicked: {
43 | showChangeDirDialog()
44 | }
45 | }
46 |
47 | FileDialog {
48 | id: fileDialog
49 | title: qsTr("Please choose a directory")
50 | folder: "file:///" + fileMode.dirPath
51 | selectFolder:true
52 | selectMultiple:false
53 | onAccepted: {
54 | console.log("You chose: " + fileDialog.fileUrls)
55 | dirPath = fileDialog.fileUrl
56 | }
57 | }
58 | }
59 |
60 | ItemSelectionModel {
61 | id: sel
62 | model: fileMode
63 | }
64 |
65 | TreeView {
66 | id: view
67 | anchors.top: top_item.visible?top_item.bottom:parent.top
68 | width: parent.width
69 | anchors.bottom: parent.bottom
70 | model: fileMode
71 | rootIndex: fileMode.rootIndex
72 | selection: sel
73 | headerVisible: false
74 |
75 | TableViewColumn {
76 | role: "fileName"
77 | }
78 |
79 | FileTreeRightMenu{
80 | id:right_menu
81 | }
82 |
83 | style:FileTreeViewStyle{}
84 |
85 | onDoubleClicked: {
86 | if(!fileMode.data(index, FileModel.IsDirRole)){
87 | selectTitle = fileMode.data(index, FileModel.BaseNameStringRole)
88 | pathSelected(fileMode.data(index, FileModel.UrlStringRole))
89 | }else{
90 | if(view.isExpanded(index)){
91 | view.collapse(index)
92 | }else{
93 | view.expand(index)
94 | }
95 |
96 | }
97 | }
98 |
99 | MouseArea {
100 | anchors.fill: parent
101 | propagateComposedEvents: true
102 | acceptedButtons: Qt.RightButton
103 | onClicked: mouse.accepted = false;
104 | onPressed: {
105 | var index_t = parent.indexAt(mouse.x,mouse.y)
106 | right_menu.x = mouse.x
107 | right_menu.y = mouse.y
108 | right_menu.visible = true
109 | view.selection.setCurrentIndex(index_t,ItemSelectionModel.Select)
110 | right_menu.reload(index_t)
111 | mouse.accepted = false;
112 | }
113 | onReleased: mouse.accepted = false;
114 | onDoubleClicked: mouse.accepted = false;
115 | onPositionChanged: mouse.accepted = false;
116 | onPressAndHold: mouse.accepted = false;
117 | }
118 | }
119 |
120 | onDirPathChanged: {
121 | fileMode.dirPath = dirPath
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/MarkdownEditor.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.10
2 | import QtQuick.Controls 2.2
3 | import QtQuick.Controls.Styles 1.4
4 | import QtQuick.Dialogs 1.3
5 | import cxl.normal 1.0
6 |
7 | Flickable{
8 | anchors.leftMargin: root.stepSize*3
9 | // anchors.bottomMargin: root.stepSize*3
10 | // anchors.topMargin: root.stepSize*3
11 | // boundsBehavior: Flickable.OvershootBounds
12 | ScrollBar.vertical: scroller
13 | property string text
14 | property string path
15 |
16 | TextArea.flickable: TextArea{
17 | id:text_area
18 | selectByMouse: true
19 | text: editor.text
20 | font.pixelSize: 15
21 | font.family: "Microsoft YaHei UI"
22 | rightPadding:20
23 | onTextChanged: {
24 | if(editor.text !== text_area.text){
25 | editor.text = text_area.text
26 | navigation_bar.setCurrentItemUnsaved(true)
27 | }
28 | }
29 | }
30 |
31 | Shortcut {
32 | sequence: StandardKey.Save
33 | context: Qt.ApplicationShortcut
34 | onActivated: {
35 | if(navigation_bar.isCurrentItemUnsaved()){
36 | if(path !== null && path.length !== 0){
37 | saveDoc(path)
38 | }else{
39 | save_file_dialog.visible = true
40 | }
41 | }
42 | }
43 | }
44 |
45 | function saveDoc(path){
46 | var ret = utils.saveDocToFile(editor.text,path)
47 | console.log("saved "+path +" "+ret)
48 | navigation_bar.setCurrentItemUnsaved(!ret)
49 | }
50 |
51 | FileDialog{
52 | id:save_file_dialog
53 | title: qsTr("Save File")
54 | folder: shortcuts.home
55 | selectMultiple: false
56 | selectExisting :false
57 | selectFolder:false
58 | nameFilters: [qsTr("Markdown Files (*.md)"),qsTr("Text Files (*.txt)"),qsTr("All Files (*.*)")]
59 | onAccepted: {
60 | saveDoc(fileUrl)
61 | editor.path = fileUrl
62 | navigation_bar.changeCurrentPath(fileUrl)
63 | }
64 | }
65 | }
66 |
67 |
68 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/MarkdownViewer.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.2
2 | import QtQuick.Controls 2.2
3 | import QtWebChannel 1.0
4 | import QtWebEngine 1.1
5 | import QtQml 2.2
6 | import QtWebEngine 1.6
7 |
8 | import cxl.normal 1.0
9 |
10 |
11 | Item {
12 | id: flick
13 | property string text
14 | WebEngineView{
15 | id:web_view
16 | url: "qrc:/index.html"
17 | anchors.fill: parent
18 | settings.showScrollBars:false
19 | focus: true
20 | webChannel:WebChannel{
21 | registeredObjects:[m_content]
22 | }
23 |
24 | Document{
25 | id:m_content
26 | text:viewer.text
27 | WebChannel.id:"content"
28 | }
29 | }
30 |
31 | MouseArea{
32 | id:view_area
33 | width: web_view.width
34 | height: web_view.height
35 | property bool callScrollUp: false
36 | property double scrollEnhance: 0
37 | acceptedButtons: Qt.LeftButton | Qt.RightButton
38 | onWheel: {
39 | scroll_run_timer.stop()
40 | scroll_stop_timer.stop()
41 | scroll_start_timer.stop()
42 | if(wheel.angleDelta.y > 0){
43 | callScrollUp = false
44 | }else{
45 | callScrollUp = true
46 | }
47 | scroller.stepSize = 0.02
48 | updateScroller()
49 | scroll_start_timer.start()
50 | }
51 |
52 | function updateScroller(){
53 | if(callScrollUp){
54 | if(web_view.height > editor.contentHeight){
55 | editor.contentHeight = web_view.height +100
56 | }
57 | scroller.increase()
58 | }else{
59 | scroller.decrease()
60 | }
61 | }
62 |
63 | Timer{
64 | id:scroll_run_timer
65 | interval: 10
66 | repeat: true
67 | onTriggered: {
68 | view_area.updateScroller()
69 | scroll_run_timer.interval++
70 | scroller.stepSize -= scroller.stepSize/5
71 | }
72 | }
73 |
74 | Timer{
75 | id:scroll_stop_timer
76 | interval: 500
77 | onTriggered: {
78 | scroll_run_timer.stop()
79 | scroll_run_timer.interval = 10
80 | }
81 | }
82 |
83 | Timer{
84 | id:scroll_start_timer
85 | interval: 20
86 | onTriggered: {
87 | scroll_run_timer.restart()
88 | scroll_stop_timer.restart()
89 | }
90 | }
91 | }
92 |
93 | Connections {
94 | target:scroller
95 | onPositionChanged: {
96 | web_view.runJavaScript(
97 | "document.documentElement.scrollHeight",
98 | function (i_actualPageWidth) {
99 | view_area.scrollEnhance = editor.contentY/(editor.contentHeight-editor.height) *
100 | (i_actualPageWidth-web_view.height)
101 | })
102 | web_view.runJavaScript("window.scrollTo(0,"+view_area.scrollEnhance+")")
103 | }
104 | }
105 | }
106 |
107 |
108 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/SettingsItem.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.10
2 | import "./items"
3 |
4 | Item {
5 | id:set_item
6 | x:0
7 | y:0
8 |
9 | signal callChangeDir()
10 | signal callOnlyEdit()
11 | signal callOnlyRead()
12 | signal callReadEdit()
13 |
14 | property int offset:{
15 | var w = set_hollow.width + list_set.width + edit_set.width+look_set.width+ edit_look_set.width +itemMargin*5
16 | if( set_hollow.x+w > root.width){
17 | return -w;
18 | }
19 | return w;
20 | }
21 |
22 | property int itemMargin: 10
23 |
24 | Rectangle{
25 | id:sets_background
26 | anchors.left: set_hollow.left
27 | anchors.verticalCenter: set_hollow.verticalCenter
28 | anchors.right: set_solid.right
29 | anchors.margins: -5
30 | height: set_hollow.height+itemMargin
31 | color: "#e0e0e0"
32 | radius: 8
33 | }
34 |
35 | Image{
36 | id:set_solid
37 | width: 30
38 | height: width
39 | x:set_hollow.x
40 | y:set_hollow.y
41 | source: "qrc:/item/images/svg/sets/set_solid.svg"
42 | MouseArea{
43 | anchors.fill: parent
44 | onClicked: changeState()
45 | }
46 | }
47 |
48 | Image{
49 | id:set_hollow
50 | y:root.height - set_hollow.height*2
51 | x:set_hollow.width
52 | width: set_solid.width
53 | height: width
54 | source: "qrc:/item/images/svg/sets/set_hollow.svg"
55 |
56 | MouseArea{
57 | id:set_hollow_area
58 | anchors.fill: parent
59 | drag{
60 | target: parent
61 | axis: Drag.XAndYAxis
62 | minimumX: -set_hollow.width+5
63 | maximumX: root.width - 5
64 | minimumY: 0
65 | maximumY: root.height -set_hollow.height
66 | }
67 | onClicked: changeState()
68 | }
69 | }
70 |
71 | ImageButton{
72 | id:list_set
73 | x:offset > 0? set_hollow.x + set_hollow.width+itemMargin:set_hollow.x - list_set.width - itemMargin
74 | anchors.verticalCenter: set_hollow.verticalCenter
75 | width: 30;height: list_set.width
76 | imageSource: "qrc:/item/images/svg/sets/file_list.svg"
77 | onClicked: callChangeDir()
78 | normalColor: sets_background.color
79 | hoverColor: "#ffffff"
80 | }
81 |
82 | ImageButton{
83 | id:edit_set
84 | x:offset > 0? list_set.x + list_set.width+itemMargin:list_set.x - edit_set.width - itemMargin
85 | anchors.verticalCenter: set_hollow.verticalCenter
86 | width: list_set.width;height: list_set.width
87 | opacity:list_set.opacity
88 | visible: list_set.visible
89 | imageSource: "qrc:/item/images/svg/sets/edit.svg"
90 | onClicked: callOnlyEdit()
91 | normalColor: sets_background.color
92 | hoverColor: list_set.hoverColor
93 | }
94 |
95 |
96 | ImageButton{
97 | id:look_set
98 | x:offset > 0? edit_set.x + edit_set.width+itemMargin:edit_set.x - look_set.width - itemMargin
99 | anchors.verticalCenter: set_hollow.verticalCenter
100 | width: edit_set.width;height: look_set.width
101 | opacity:list_set.opacity
102 | normalColor: sets_background.color
103 | hoverColor: list_set.hoverColor
104 | imageSource: "qrc:/item/images/svg/sets/look.svg"
105 | onClicked: callOnlyRead()
106 | }
107 |
108 |
109 | ImageButton{
110 | id:edit_look_set
111 | x:offset > 0? look_set.x + look_set.width+itemMargin:look_set.x - edit_look_set.width - itemMargin
112 | anchors.verticalCenter: set_hollow.verticalCenter
113 | width: edit_set.width;height: look_set.width
114 | opacity:list_set.opacity
115 | imageSource: "qrc:/item/images/svg/sets/edit_view.svg"
116 | onClicked: callReadEdit()
117 | normalColor: sets_background.color
118 | hoverColor: list_set.hoverColor
119 | }
120 |
121 | function changeState(){
122 | if(set_item.state == "SETTING"){
123 | set_item.state ="UNSET"
124 | }else{
125 | set_item.state ="SETTING"
126 | }
127 | }
128 |
129 | state:"UNSET"
130 |
131 | states: [
132 | State {
133 | name: "SETTING"
134 | PropertyChanges { target: set_solid; x: set_hollow.x+offset}
135 | PropertyChanges { target: set_solid; rotation: 180}
136 | PropertyChanges { target: list_set; opacity:1}
137 | },
138 | State {
139 | name: "UNSET"
140 | PropertyChanges { target: set_solid; x: set_hollow.x}
141 | PropertyChanges { target: set_solid; rotation: 0}
142 | PropertyChanges { target: list_set; opacity:0 }
143 | }
144 | ]
145 |
146 | transitions: [
147 | Transition {
148 | from: "SETTING"
149 | to: "UNSET"
150 | PropertyAnimation {target: set_solid; duration: 200;properties: "x"; easing.type: Easing.InOutQuad}
151 | PropertyAnimation {target: set_solid; duration: 200;properties: "rotation"; easing.type: Easing.Linear}
152 | PropertyAnimation {target: list_set; duration: 500;properties: "opacity"; easing.type: Easing.Linear}
153 | },
154 | Transition {
155 | from: "UNSET"
156 | to: "SETTING"
157 | PropertyAnimation { target: set_solid; duration: 200;properties: "x"; easing.type: Easing.InOutQuad}
158 | PropertyAnimation {target: set_solid; duration: 200;properties: "rotation"; easing.type: Easing.Linear}
159 | PropertyAnimation {target: list_set; duration: 500;properties: "opacity"; easing.type: Easing.Linear}
160 | }
161 | ]
162 | }
163 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/items/ImageButton.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.4
2 |
3 | Rectangle{
4 | id:_rect
5 | property color normalColor
6 | property color hoverColor
7 | property url imageSource
8 |
9 | signal clicked()
10 |
11 | radius: width/5
12 | color: _rect_area.containsMouse?hoverColor:normalColor
13 | Image{
14 | anchors.fill: parent
15 | anchors.margins: parent.width/6
16 | mipmap:true
17 | source: imageSource
18 | MouseArea{
19 | id:_rect_area
20 | anchors.fill: parent
21 | hoverEnabled: true
22 | onClicked: _rect.clicked()
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/navigationbar/TitleNavigationBar.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.10
2 |
3 | Rectangle {
4 | color:"#ffffff"
5 | property var tiltes:[]
6 |
7 | signal titleChecked(var title_data)
8 | signal callAddPage()
9 |
10 | function hasItemUnsaved(){
11 | for(var i = 0;i= 0 && titles_list.count > index){
21 | titles_mode.setProperty(index,"doc",doc)
22 | }
23 | }
24 |
25 | function setCurrentItemUnsaved(status){
26 | if(titles_list.currentIndex >= 0){
27 | titles_mode.setProperty(titles_list.currentIndex,"unsaved",status)
28 | }
29 | }
30 |
31 | function isCurrentItemUnsaved(){
32 | if(titles_list.currentIndex >= 0){
33 | return titles_mode.get(titles_list.currentIndex).unsaved;
34 | }
35 |
36 | return true;
37 | }
38 |
39 | function touchItem(title,path,doc){
40 | var i = titles_mode.getIndexByPath(path)
41 | console.log("touch title:"+title+" path:"+path+" i:"+i)
42 | if(i === -1){
43 | if((parent.width - 60)/(titles_mode.count+1) > 50 ){
44 | var js = {"title":title,"path":path,"unsaved":false,"doc":doc}
45 | titles_mode.append(js)
46 | titles_list.currentIndex = titles_mode.count-1
47 | }else{
48 | //too many titles
49 | }
50 | }else{
51 | titles_list.currentIndex = i
52 | }
53 | }
54 |
55 | function changeCurrentPath(new_path){
56 | var new_path_str = JSON.stringify(new_path)
57 | var i = titles_mode.getIndexByPath(new_path_str)
58 | if(i === -1){
59 | if(titles_list.currentIndex >= 0){
60 | //current is null path
61 | titles_mode.setProperty(titles_list.currentIndex,"title",
62 | utils.getBaseNameFromPath(new_path))
63 | titles_mode.setProperty(titles_list.currentIndex,"path",new_path_str)
64 | }else{
65 | //title list is null
66 | touchItem(utils.getBaseNameFromPath(new_path),new_path_str,editor.text)
67 | }
68 | }else if(i === titles_list.currentIndex){
69 | //current and new path is same
70 | }else{
71 | //new path is existed
72 | titles_mode.setProperty(titles_list.currentIndex,"title",
73 | utils.getBaseNameFromPath(new_path))
74 | titles_mode.setProperty(titles_list.currentIndex,"path",new_path_str)
75 | titles_mode.setProperty(titles_list.currentIndex,"doc",editor.text)
76 | console.log("will remove same title "+i+" "+new_path_str)
77 | titles_mode.remove(i,1)
78 | }
79 | }
80 |
81 | ListView{
82 | id:titles_list
83 | anchors.left: parent.left
84 | anchors.top: parent.top
85 | anchors.bottom:parent.bottom
86 | orientation: ListView.Horizontal
87 | width: itemWidth*titles_mode.count
88 | model: titles_mode
89 | interactive:false
90 |
91 | property int itemWidth: {
92 | var h = 50;
93 | if(titles_mode.count > 0){
94 | h = (parent.width - 60)/titles_mode.count;
95 | if(h > parent.width /3){
96 | h = parent.width /3;
97 | }else if( h < 50){
98 | h = 50;
99 | }
100 | }
101 | return h;
102 | }
103 |
104 | delegate:TitleNavigationItem{}
105 |
106 | property int indexSave: -1
107 | onCurrentIndexChanged: {
108 | setItemDoc(editor.text,indexSave)
109 |
110 | if(currentIndex >= 0){
111 | titleChecked(titles_mode.get(currentIndex))
112 | }else{
113 | var js = {"title":null,"path":null,"unsaved":false,"doc":null}
114 | titleChecked(js)
115 | }
116 |
117 | indexSave = currentIndex
118 | }
119 | }
120 |
121 | Image {
122 | anchors.verticalCenter: titles_list.verticalCenter
123 | anchors.left: titles_list.right
124 | anchors.leftMargin: 5
125 | width: 20
126 | height: 20
127 | source: "qrc:/item/images/svg/add.svg"
128 | MouseArea{
129 | anchors.fill: parent
130 | onClicked: {
131 | callAddPage()
132 | }
133 | }
134 | }
135 |
136 | ListModel{
137 | id:titles_mode
138 | function getIndexByPath(path){
139 | if(path === null)
140 | return -1;
141 |
142 | for(var i = 0;i < count;i++){
143 | if(path === get(i).path ){
144 | return i;
145 | }
146 | }
147 | return -1;
148 | }
149 | }
150 |
151 | Item {
152 | id: add_btn
153 | anchors.left: titles_list.right
154 | anchors.top: parent.top
155 | anchors.bottom:parent.bottom
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/navigationbar/TitleNavigationItem.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 | import QtQuick.Controls 2.0
3 |
4 | Component{
5 | Rectangle{
6 | id:title_text
7 | width: titles_list.itemWidth
8 | height: titles_list.height
9 | radius: height/4
10 |
11 | color:ListView.isCurrentItem?colorSelect:colorNormal
12 |
13 | property color colorSelect: "#efefef"
14 | property color colorNormal: "#ffffff"
15 | property bool isNormal: !ListView.isCurrentItem && !item_area.containsMouse && !delete_btn_area.containsMouse
16 |
17 | Rectangle{
18 | anchors.bottom: parent.bottom
19 | anchors.left:parent.left
20 | anchors.right: parent.right
21 | color: parent.color
22 | height: parent.radius
23 | }
24 |
25 | Image{
26 | anchors.left: parent.left
27 | anchors.verticalCenter: parent.verticalCenter
28 | source: "qrc:/item/images/svg/point.svg"
29 | width: 20
30 | height: 20
31 | visible: unsaved
32 | }
33 |
34 | Text {
35 | id:tilte_text
36 | text: title
37 | anchors.centerIn: parent
38 | }
39 |
40 | MouseArea{
41 | id:item_area
42 | anchors.fill: parent
43 | onClicked:titles_list.currentIndex = index
44 | hoverEnabled: true
45 | onEntered: {
46 | var tmp = titles_mode.get(index).path
47 | if (typeof tmp !== 'undefined'){
48 | title_path_tooltip.visible = true
49 | }
50 | }
51 | onExited: title_path_tooltip.visible = false
52 | ToolTip{
53 | id:title_path_tooltip
54 | delay:500
55 | onVisibleChanged:{
56 | if(title_path_tooltip.visible){
57 | title_path_tooltip.text = utils.filterNativeSeparators(titles_mode.get(index).path)
58 | }
59 | }
60 | }
61 | }
62 |
63 | Rectangle{
64 | id:delete_btn
65 | anchors.right: parent.right
66 | anchors.rightMargin: 10
67 | anchors.verticalCenter: parent.verticalCenter
68 | visible: !isNormal
69 | width: 20
70 | height: 20
71 | radius: width/2
72 | color: delete_btn_area.containsMouse?colorNormal:parent.color
73 |
74 | Image{
75 | anchors.centerIn: parent
76 | width: 10
77 | height: 10
78 | source: "qrc:/item/images/svg/delete.svg"
79 | }
80 |
81 | MouseArea{
82 | id:delete_btn_area
83 | anchors.fill: parent
84 | hoverEnabled: true
85 | onClicked: titles_mode.remove(index,1)
86 | }
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/partition/DragLine.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.4
2 |
3 | Rectangle {
4 | x: (parent.width-width+file_view.width)/2
5 | width: 2
6 | height: parent.height
7 |
8 | MouseArea {
9 | anchors.fill: parent
10 | cursorShape : Qt.SplitHCursor
11 | drag{
12 | target: parent
13 | axis: Drag.XAxis
14 | minimumX: file_view.width
15 | maximumX: root.width
16 | }
17 |
18 | onPressed: root_area.cursorShape = Qt.SplitHCursor
19 | onReleased: root_area.cursorShape = Qt.ArrowCursor
20 | }
21 |
22 | state:"EDITVIEW"
23 |
24 | states: [
25 | State {
26 | name: "EDIT"
27 | PropertyChanges { target: drog_line; x: root.width}
28 | },
29 | State {
30 | name: "VIEW"
31 | PropertyChanges { target: drog_line; x: file_view.width}
32 | },
33 | State {
34 | name: "EDITVIEW"
35 | PropertyChanges { target: drog_line; x: (root.width-drog_line.width+file_view.width)/2}
36 | }
37 | ]
38 |
39 | transitions: [
40 | Transition {
41 | PropertyAnimation { properties: "x"; easing.type: Easing.InOutQuad }
42 | }
43 | ]
44 | }
45 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/custom/partition/Triangle.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.0
2 |
3 | Canvas {
4 | id:canvas
5 | implicitWidth: 10
6 | implicitHeight: 10
7 | height: width
8 | property color color:"#a0a0a0"
9 | property int rightTop: 0
10 | property int rightBottom: 1
11 | property int leftTop: 2
12 | property int leftBottom: 3
13 |
14 | property int trianglePosition:rightBottom
15 | signal clicked()
16 |
17 | onPaint: {
18 | var ctx = getContext("2d");
19 | ctx.fillStyle = color
20 |
21 | var sWidth = canvas.width;
22 | var sHeight = canvas.height;
23 | ctx.beginPath();
24 | if(trianglePosition === rightTop){
25 | ctx.moveTo(0,0);
26 | ctx.lineTo(sWidth,sHeight);
27 | ctx.lineTo(sWidth,0);
28 | }else if(trianglePosition === leftBottom){
29 | ctx.moveTo(0,0);
30 | ctx.lineTo(sWidth,sHeight);
31 | ctx.lineTo(0,height);
32 | }else if(trianglePosition === leftTop){
33 | ctx.moveTo(sWidth,0);
34 | ctx.lineTo(0,sHeight);
35 | ctx.lineTo(0,0);
36 | }else if(trianglePosition === rightBottom){
37 | ctx.moveTo(sWidth,0);
38 | ctx.lineTo(0,sHeight);
39 | ctx.lineTo(sWidth,sHeight);
40 | }
41 |
42 | ctx.closePath();
43 | ctx.fill();
44 | }
45 | MouseArea{
46 | id:_triangle_area
47 | anchors.fill: parent
48 | cursorShape:Qt.PointingHandCursor
49 | onClicked: parent.clicked()
50 | }
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/markdowneditor/qmls/main.qml:
--------------------------------------------------------------------------------
1 | import QtQuick 2.2
2 | import QtQuick.Controls 2.2
3 | import QtQuick.Layouts 1.0
4 | import QtQuick.Dialogs 1.1
5 | import QtQuick.Window 2.1
6 | import QtQuick.Controls.Styles 1.4
7 |
8 | import "./custom"
9 | import "./custom/partition"
10 | import "./custom/FileTree"
11 | import "./custom/navigationbar"
12 | import cxl.normal 1.0
13 |
14 | ApplicationWindow {
15 | id:root
16 | visible: true
17 | width: 1340
18 | height: 820
19 | minimumWidth: 640
20 | minimumHeight: 480
21 | title: " "
22 | color:"#efefef"
23 | // flags: Qt.FramelessWindowHint | Qt.Window
24 | property int stepSize: 15
25 |
26 | MouseArea{
27 | id:root_area
28 | anchors.fill: parent
29 | }
30 |
31 | Utils{
32 | id:utils
33 | }
34 |
35 | TitleNavigationBar{
36 | id:navigation_bar
37 | anchors.top: file_view.top
38 | anchors.left: file_view.right
39 | anchors.right: drog_line.left
40 | height: 30
41 |
42 | onTitleChecked: {
43 | if(title_data.path !== null){
44 | editor.text = title_data.doc
45 | editor.path = typeof title_data.path === 'undefined'?null:title_data.path
46 | }else{
47 | editor.text = ""
48 | }
49 | }
50 |
51 | onCallAddPage: {
52 | touchItem(qsTr("New Page"),null,"")
53 | }
54 | }
55 |
56 | MarkdownEditor{
57 | id:editor
58 | anchors.top: navigation_bar.bottom
59 | anchors.left: file_view.right
60 | anchors.right: drog_line.left
61 | anchors.bottom: parent.bottom
62 | onTextChanged: {
63 | viewer.text = editor.text
64 | }
65 | }
66 |
67 | ScrollBar{
68 | id: scroller
69 | anchors.right: drog_line.left
70 | anchors.top: parent.top
71 | anchors.bottom: parent.bottom
72 | }
73 |
74 | DragLine{
75 | id:drog_line
76 | }
77 |
78 | Rectangle{
79 | color:"#ffffff"
80 | anchors.top: parent.top
81 | anchors.right: parent.right
82 | anchors.bottom: parent.bottom
83 | anchors.left: viewer.left
84 | }
85 |
86 | MarkdownViewer{
87 | id:viewer
88 | anchors.top:parent.top
89 | anchors.left: drog_line.right
90 | anchors.right: parent.right
91 | anchors.bottom: parent.bottom
92 | // anchors.bottomMargin: root.stepSize*3
93 | // anchors.topMargin: root.stepSize*3
94 | }
95 |
96 | Triangle{
97 | property bool isOnlyEdit: false
98 | anchors.bottom:drog_line.bottom
99 | anchors.right:drog_line.left
100 | onClicked: {
101 | isOnlyEdit = !isOnlyEdit
102 | if(isOnlyEdit){
103 | drog_line.state = "EDIT"
104 | }else{
105 | drog_line.state = "EDITVIEW"
106 | }
107 | }
108 | }
109 |
110 | Triangle{
111 | property bool isOnlyRead: false
112 | anchors.bottom:parent.bottom
113 | anchors.left:drog_line.left
114 | trianglePosition:leftBottom
115 | color: "#c0c0c0"
116 | onClicked: {
117 | isOnlyRead = !isOnlyRead
118 | if(isOnlyRead){
119 | drog_line.state = "VIEW"
120 | }else{
121 | drog_line.state = "EDITVIEW"
122 | }
123 | }
124 | }
125 |
126 | SubTree{
127 | id:file_view
128 | anchors.top: parent.top
129 | anchors.left: parent.left
130 | anchors.bottom: parent.bottom
131 | fileMode:fileModel
132 | enableChangeDir: true
133 | width:200
134 |
135 | onPathSelected: {
136 | navigation_bar.touchItem(file_view.selectTitle,path,utils.readFile(path))
137 | }
138 | }
139 |
140 | SettingsItem{
141 | visible: false
142 | onCallChangeDir: file_view.showChangeDirDialog()
143 | onCallOnlyEdit: drog_line.state = "EDIT"
144 | onCallOnlyRead: drog_line.state = "VIEW"
145 | onCallReadEdit: drog_line.state = "EDITVIEW"
146 | }
147 |
148 | DragArea{
149 | anchors.fill: parent
150 | onTextDrop: {
151 | editor.text += text
152 | navigation_bar.setCurrentItemUnsaved(true)
153 | }
154 | onFileDrop: navigation_bar.touchItem(utils.getBaseNameFromPath(file_path),
155 | file_path,utils.readFile(file_path))
156 | }
157 |
158 | Component.onCompleted: {
159 | if(typeof argPath !== 'undefined'){
160 | navigation_bar.touchItem(utils.getBaseNameFromPath(argPath),
161 | argPath,utils.readFile(argPath))
162 | }
163 | }
164 |
165 | property bool sureClose: false
166 |
167 | onClosing: {
168 | if(navigation_bar.hasItemUnsaved() && !sureClose){
169 | message_dialog.visible = true
170 | close.accepted = false
171 | }
172 | }
173 |
174 | Dialog{
175 | id:message_dialog
176 | title: qsTr("Warning")
177 | x: (parent.width - width) / 2
178 | y: (parent.height - height) / 2
179 | onAccepted: {
180 | sureClose = true
181 | root.close()
182 | }
183 |
184 | contentItem: Rectangle {
185 | implicitWidth: 300
186 | implicitHeight: 60
187 | Text {
188 | text: qsTr("You have unsaved content, are you sure to close?")
189 | anchors.centerIn: parent
190 | }
191 | }
192 |
193 | standardButtons:StandardButton.Yes|StandardButton.Cancel
194 | }
195 | }
196 |
--------------------------------------------------------------------------------
/markdowneditor/resources/3rdparty/markdown.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: octicons-link;
3 | src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff');
4 | }
5 |
6 | .markdown-body {
7 | -ms-text-size-adjust: 100%;
8 | -webkit-text-size-adjust: 100%;
9 | line-height: 1.5;
10 | color: #24292e;
11 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
12 | font-size: 16px;
13 | line-height: 1.5;
14 | word-wrap: break-word;
15 | }
16 |
17 | .markdown-body .pl-c {
18 | color: #6a737d;
19 | }
20 |
21 | .markdown-body .pl-c1,
22 | .markdown-body .pl-s .pl-v {
23 | color: #005cc5;
24 | }
25 |
26 | .markdown-body .pl-e,
27 | .markdown-body .pl-en {
28 | color: #6f42c1;
29 | }
30 |
31 | .markdown-body .pl-smi,
32 | .markdown-body .pl-s .pl-s1 {
33 | color: #24292e;
34 | }
35 |
36 | .markdown-body .pl-ent {
37 | color: #22863a;
38 | }
39 |
40 | .markdown-body .pl-k {
41 | color: #d73a49;
42 | }
43 |
44 | .markdown-body .pl-s,
45 | .markdown-body .pl-pds,
46 | .markdown-body .pl-s .pl-pse .pl-s1,
47 | .markdown-body .pl-sr,
48 | .markdown-body .pl-sr .pl-cce,
49 | .markdown-body .pl-sr .pl-sre,
50 | .markdown-body .pl-sr .pl-sra {
51 | color: #032f62;
52 | }
53 |
54 | .markdown-body .pl-v,
55 | .markdown-body .pl-smw {
56 | color: #e36209;
57 | }
58 |
59 | .markdown-body .pl-bu {
60 | color: #b31d28;
61 | }
62 |
63 | .markdown-body .pl-ii {
64 | color: #fafbfc;
65 | background-color: #b31d28;
66 | }
67 |
68 | .markdown-body .pl-c2 {
69 | color: #fafbfc;
70 | background-color: #d73a49;
71 | }
72 |
73 | .markdown-body .pl-c2::before {
74 | content: "^M";
75 | }
76 |
77 | .markdown-body .pl-sr .pl-cce {
78 | font-weight: bold;
79 | color: #22863a;
80 | }
81 |
82 | .markdown-body .pl-ml {
83 | color: #735c0f;
84 | }
85 |
86 | .markdown-body .pl-mh,
87 | .markdown-body .pl-mh .pl-en,
88 | .markdown-body .pl-ms {
89 | font-weight: bold;
90 | color: #005cc5;
91 | }
92 |
93 | .markdown-body .pl-mi {
94 | font-style: italic;
95 | color: #24292e;
96 | }
97 |
98 | .markdown-body .pl-mb {
99 | font-weight: bold;
100 | color: #24292e;
101 | }
102 |
103 | .markdown-body .pl-md {
104 | color: #b31d28;
105 | background-color: #ffeef0;
106 | }
107 |
108 | .markdown-body .pl-mi1 {
109 | color: #22863a;
110 | background-color: #f0fff4;
111 | }
112 |
113 | .markdown-body .pl-mc {
114 | color: #e36209;
115 | background-color: #ffebda;
116 | }
117 |
118 | .markdown-body .pl-mi2 {
119 | color: #f6f8fa;
120 | background-color: #005cc5;
121 | }
122 |
123 | .markdown-body .pl-mdr {
124 | font-weight: bold;
125 | color: #6f42c1;
126 | }
127 |
128 | .markdown-body .pl-ba {
129 | color: #586069;
130 | }
131 |
132 | .markdown-body .pl-sg {
133 | color: #959da5;
134 | }
135 |
136 | .markdown-body .pl-corl {
137 | text-decoration: underline;
138 | color: #032f62;
139 | }
140 |
141 | .markdown-body .octicon {
142 | display: inline-block;
143 | vertical-align: text-top;
144 | fill: currentColor;
145 | }
146 |
147 | .markdown-body a {
148 | background-color: transparent;
149 | }
150 |
151 | .markdown-body a:active,
152 | .markdown-body a:hover {
153 | outline-width: 0;
154 | }
155 |
156 | .markdown-body strong {
157 | font-weight: inherit;
158 | }
159 |
160 | .markdown-body strong {
161 | font-weight: bolder;
162 | }
163 |
164 | .markdown-body h1 {
165 | font-size: 2em;
166 | margin: 0.67em 0;
167 | }
168 |
169 | .markdown-body img {
170 | border-style: none;
171 | }
172 |
173 | .markdown-body code,
174 | .markdown-body kbd,
175 | .markdown-body pre {
176 | font-family: monospace, monospace;
177 | font-size: 1em;
178 | }
179 |
180 | .markdown-body hr {
181 | box-sizing: content-box;
182 | height: 0;
183 | overflow: visible;
184 | }
185 |
186 | .markdown-body input {
187 | font: inherit;
188 | margin: 0;
189 | }
190 |
191 | .markdown-body input {
192 | overflow: visible;
193 | }
194 |
195 | .markdown-body [type="checkbox"] {
196 | box-sizing: border-box;
197 | padding: 0;
198 | }
199 |
200 | .markdown-body * {
201 | box-sizing: border-box;
202 | }
203 |
204 | .markdown-body input {
205 | font-family: inherit;
206 | font-size: inherit;
207 | line-height: inherit;
208 | }
209 |
210 | .markdown-body a {
211 | color: #0366d6;
212 | text-decoration: none;
213 | }
214 |
215 | .markdown-body a:hover {
216 | text-decoration: underline;
217 | }
218 |
219 | .markdown-body strong {
220 | font-weight: 600;
221 | }
222 |
223 | .markdown-body hr {
224 | height: 0;
225 | margin: 15px 0;
226 | overflow: hidden;
227 | background: transparent;
228 | border: 0;
229 | border-bottom: 1px solid #dfe2e5;
230 | }
231 |
232 | .markdown-body hr::before {
233 | display: table;
234 | content: "";
235 | }
236 |
237 | .markdown-body hr::after {
238 | display: table;
239 | clear: both;
240 | content: "";
241 | }
242 |
243 | .markdown-body table {
244 | border-spacing: 0;
245 | border-collapse: collapse;
246 | }
247 |
248 | .markdown-body td,
249 | .markdown-body th {
250 | padding: 0;
251 | }
252 |
253 | .markdown-body h1,
254 | .markdown-body h2,
255 | .markdown-body h3,
256 | .markdown-body h4,
257 | .markdown-body h5,
258 | .markdown-body h6 {
259 | margin-top: 0;
260 | margin-bottom: 0;
261 | }
262 |
263 | .markdown-body h1 {
264 | font-size: 32px;
265 | font-weight: 600;
266 | }
267 |
268 | .markdown-body h2 {
269 | font-size: 24px;
270 | font-weight: 600;
271 | }
272 |
273 | .markdown-body h3 {
274 | font-size: 20px;
275 | font-weight: 600;
276 | }
277 |
278 | .markdown-body h4 {
279 | font-size: 16px;
280 | font-weight: 600;
281 | }
282 |
283 | .markdown-body h5 {
284 | font-size: 14px;
285 | font-weight: 600;
286 | }
287 |
288 | .markdown-body h6 {
289 | font-size: 12px;
290 | font-weight: 600;
291 | }
292 |
293 | .markdown-body p {
294 | margin-top: 0;
295 | margin-bottom: 10px;
296 | }
297 |
298 | .markdown-body blockquote {
299 | margin: 0;
300 | }
301 |
302 | .markdown-body ul,
303 | .markdown-body ol {
304 | padding-left: 0;
305 | margin-top: 0;
306 | margin-bottom: 0;
307 | }
308 |
309 | .markdown-body ol ol,
310 | .markdown-body ul ol {
311 | list-style-type: lower-roman;
312 | }
313 |
314 | .markdown-body ul ul ol,
315 | .markdown-body ul ol ol,
316 | .markdown-body ol ul ol,
317 | .markdown-body ol ol ol {
318 | list-style-type: lower-alpha;
319 | }
320 |
321 | .markdown-body dd {
322 | margin-left: 0;
323 | }
324 |
325 | .markdown-body code {
326 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
327 | font-size: 12px;
328 | }
329 |
330 | .markdown-body pre {
331 | margin-top: 0;
332 | margin-bottom: 0;
333 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
334 | font-size: 12px;
335 | }
336 |
337 | .markdown-body .octicon {
338 | vertical-align: text-bottom;
339 | }
340 |
341 | .markdown-body .pl-0 {
342 | padding-left: 0 !important;
343 | }
344 |
345 | .markdown-body .pl-1 {
346 | padding-left: 4px !important;
347 | }
348 |
349 | .markdown-body .pl-2 {
350 | padding-left: 8px !important;
351 | }
352 |
353 | .markdown-body .pl-3 {
354 | padding-left: 16px !important;
355 | }
356 |
357 | .markdown-body .pl-4 {
358 | padding-left: 24px !important;
359 | }
360 |
361 | .markdown-body .pl-5 {
362 | padding-left: 32px !important;
363 | }
364 |
365 | .markdown-body .pl-6 {
366 | padding-left: 40px !important;
367 | }
368 |
369 | .markdown-body::before {
370 | display: table;
371 | content: "";
372 | }
373 |
374 | .markdown-body::after {
375 | display: table;
376 | clear: both;
377 | content: "";
378 | }
379 |
380 | .markdown-body>*:first-child {
381 | margin-top: 0 !important;
382 | }
383 |
384 | .markdown-body>*:last-child {
385 | margin-bottom: 0 !important;
386 | }
387 |
388 | .markdown-body a:not([href]) {
389 | color: inherit;
390 | text-decoration: none;
391 | }
392 |
393 | .markdown-body .anchor {
394 | float: left;
395 | padding-right: 4px;
396 | margin-left: -20px;
397 | line-height: 1;
398 | }
399 |
400 | .markdown-body .anchor:focus {
401 | outline: none;
402 | }
403 |
404 | .markdown-body p,
405 | .markdown-body blockquote,
406 | .markdown-body ul,
407 | .markdown-body ol,
408 | .markdown-body dl,
409 | .markdown-body table,
410 | .markdown-body pre {
411 | margin-top: 0;
412 | margin-bottom: 16px;
413 | }
414 |
415 | .markdown-body hr {
416 | height: 0.25em;
417 | padding: 0;
418 | margin: 24px 0;
419 | background-color: #e1e4e8;
420 | border: 0;
421 | }
422 |
423 | .markdown-body blockquote {
424 | padding: 0 1em;
425 | color: #6a737d;
426 | border-left: 0.25em solid #dfe2e5;
427 | }
428 |
429 | .markdown-body blockquote>:first-child {
430 | margin-top: 0;
431 | }
432 |
433 | .markdown-body blockquote>:last-child {
434 | margin-bottom: 0;
435 | }
436 |
437 | .markdown-body kbd {
438 | display: inline-block;
439 | padding: 3px 5px;
440 | font-size: 11px;
441 | line-height: 10px;
442 | color: #444d56;
443 | vertical-align: middle;
444 | background-color: #fafbfc;
445 | border: solid 1px #c6cbd1;
446 | border-bottom-color: #959da5;
447 | border-radius: 3px;
448 | box-shadow: inset 0 -1px 0 #959da5;
449 | }
450 |
451 | .markdown-body h1,
452 | .markdown-body h2,
453 | .markdown-body h3,
454 | .markdown-body h4,
455 | .markdown-body h5,
456 | .markdown-body h6 {
457 | margin-top: 24px;
458 | margin-bottom: 16px;
459 | font-weight: 600;
460 | line-height: 1.25;
461 | }
462 |
463 | .markdown-body h1 .octicon-link,
464 | .markdown-body h2 .octicon-link,
465 | .markdown-body h3 .octicon-link,
466 | .markdown-body h4 .octicon-link,
467 | .markdown-body h5 .octicon-link,
468 | .markdown-body h6 .octicon-link {
469 | color: #1b1f23;
470 | vertical-align: middle;
471 | visibility: hidden;
472 | }
473 |
474 | .markdown-body h1:hover .anchor,
475 | .markdown-body h2:hover .anchor,
476 | .markdown-body h3:hover .anchor,
477 | .markdown-body h4:hover .anchor,
478 | .markdown-body h5:hover .anchor,
479 | .markdown-body h6:hover .anchor {
480 | text-decoration: none;
481 | }
482 |
483 | .markdown-body h1:hover .anchor .octicon-link,
484 | .markdown-body h2:hover .anchor .octicon-link,
485 | .markdown-body h3:hover .anchor .octicon-link,
486 | .markdown-body h4:hover .anchor .octicon-link,
487 | .markdown-body h5:hover .anchor .octicon-link,
488 | .markdown-body h6:hover .anchor .octicon-link {
489 | visibility: visible;
490 | }
491 |
492 | .markdown-body h1 {
493 | padding-bottom: 0.3em;
494 | font-size: 2em;
495 | border-bottom: 1px solid #eaecef;
496 | }
497 |
498 | .markdown-body h2 {
499 | padding-bottom: 0.3em;
500 | font-size: 1.5em;
501 | border-bottom: 1px solid #eaecef;
502 | }
503 |
504 | .markdown-body h3 {
505 | font-size: 1.25em;
506 | }
507 |
508 | .markdown-body h4 {
509 | font-size: 1em;
510 | }
511 |
512 | .markdown-body h5 {
513 | font-size: 0.875em;
514 | }
515 |
516 | .markdown-body h6 {
517 | font-size: 0.85em;
518 | color: #6a737d;
519 | }
520 |
521 | .markdown-body ul,
522 | .markdown-body ol {
523 | padding-left: 2em;
524 | }
525 |
526 | .markdown-body ul ul,
527 | .markdown-body ul ol,
528 | .markdown-body ol ol,
529 | .markdown-body ol ul {
530 | margin-top: 0;
531 | margin-bottom: 0;
532 | }
533 |
534 | .markdown-body li {
535 | word-wrap: break-all;
536 | }
537 |
538 | .markdown-body li>p {
539 | margin-top: 16px;
540 | }
541 |
542 | .markdown-body li+li {
543 | margin-top: 0.25em;
544 | }
545 |
546 | .markdown-body dl {
547 | padding: 0;
548 | }
549 |
550 | .markdown-body dl dt {
551 | padding: 0;
552 | margin-top: 16px;
553 | font-size: 1em;
554 | font-style: italic;
555 | font-weight: 600;
556 | }
557 |
558 | .markdown-body dl dd {
559 | padding: 0 16px;
560 | margin-bottom: 16px;
561 | }
562 |
563 | .markdown-body table {
564 | display: block;
565 | width: 100%;
566 | overflow: auto;
567 | }
568 |
569 | .markdown-body table th {
570 | font-weight: 600;
571 | }
572 |
573 | .markdown-body table th,
574 | .markdown-body table td {
575 | padding: 6px 13px;
576 | border: 1px solid #dfe2e5;
577 | }
578 |
579 | .markdown-body table tr {
580 | background-color: #fff;
581 | border-top: 1px solid #c6cbd1;
582 | }
583 |
584 | .markdown-body table tr:nth-child(2n) {
585 | background-color: #f6f8fa;
586 | }
587 |
588 | .markdown-body img {
589 | max-width: 100%;
590 | box-sizing: content-box;
591 | background-color: #fff;
592 | }
593 |
594 | .markdown-body img[align=right] {
595 | padding-left: 20px;
596 | }
597 |
598 | .markdown-body img[align=left] {
599 | padding-right: 20px;
600 | }
601 |
602 | .markdown-body code {
603 | padding: 0.2em 0.4em;
604 | margin: 0;
605 | font-size: 85%;
606 | background-color: rgba(27,31,35,0.05);
607 | border-radius: 3px;
608 | }
609 |
610 | .markdown-body pre {
611 | word-wrap: normal;
612 | }
613 |
614 | .markdown-body pre>code {
615 | padding: 0;
616 | margin: 0;
617 | font-size: 100%;
618 | word-break: normal;
619 | white-space: pre;
620 | background: transparent;
621 | border: 0;
622 | }
623 |
624 | .markdown-body .highlight {
625 | margin-bottom: 16px;
626 | }
627 |
628 | .markdown-body .highlight pre {
629 | margin-bottom: 0;
630 | word-break: normal;
631 | }
632 |
633 | .markdown-body .highlight pre,
634 | .markdown-body pre {
635 | padding: 16px;
636 | overflow: auto;
637 | font-size: 85%;
638 | line-height: 1.45;
639 | background-color: #f6f8fa;
640 | border-radius: 3px;
641 | }
642 |
643 | .markdown-body pre code {
644 | display: inline;
645 | max-width: auto;
646 | padding: 0;
647 | margin: 0;
648 | overflow: visible;
649 | line-height: inherit;
650 | word-wrap: normal;
651 | background-color: transparent;
652 | border: 0;
653 | }
654 |
655 | .markdown-body .full-commit .btn-outline:not(:disabled):hover {
656 | color: #005cc5;
657 | border-color: #005cc5;
658 | }
659 |
660 | .markdown-body kbd {
661 | display: inline-block;
662 | padding: 3px 5px;
663 | font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
664 | line-height: 10px;
665 | color: #444d56;
666 | vertical-align: middle;
667 | background-color: #fafbfc;
668 | border: solid 1px #d1d5da;
669 | border-bottom-color: #c6cbd1;
670 | border-radius: 3px;
671 | box-shadow: inset 0 -1px 0 #c6cbd1;
672 | }
673 |
674 | .markdown-body :checked+.radio-label {
675 | position: relative;
676 | z-index: 1;
677 | border-color: #0366d6;
678 | }
679 |
680 | .markdown-body .task-list-item {
681 | list-style-type: none;
682 | }
683 |
684 | .markdown-body .task-list-item+.task-list-item {
685 | margin-top: 3px;
686 | }
687 |
688 | .markdown-body .task-list-item input {
689 | margin: 0 0.2em 0.25em -1.6em;
690 | vertical-align: middle;
691 | }
692 |
693 | .markdown-body hr {
694 | border-bottom-color: #eee;
695 | }
696 |
--------------------------------------------------------------------------------
/markdowneditor/resources/3rdparty/markdown.css.save:
--------------------------------------------------------------------------------
1 | body{
2 | margin: 0 auto;
3 | font-family: Georgia, Palatino, serif;
4 | color: #444444;
5 | line-height: 1;
6 | max-width: 960px;
7 | padding: 30px;
8 | }
9 | h1, h2, h3, h4 {
10 | color: #111111;
11 | font-weight: 400;
12 | }
13 | h1, h2, h3, h4, h5, p {
14 | margin-bottom: 24px;
15 | padding: 0;
16 | }
17 | h1 {
18 | font-size: 48px;
19 | }
20 | h2 {
21 | font-size: 36px;
22 | /* The bottom margin is small. It's designed to be used with gray meta text
23 | * below a post title. */
24 | margin: 24px 0 6px;
25 | }
26 | h3 {
27 | font-size: 24px;
28 | }
29 | h4 {
30 | font-size: 21px;
31 | }
32 | h5 {
33 | font-size: 18px;
34 | }
35 | a {
36 | color: #0099ff;
37 | margin: 0;
38 | padding: 0;
39 | vertical-align: baseline;
40 | }
41 | a:hover {
42 | text-decoration: none;
43 | color: #ff6600;
44 | }
45 | a:visited {
46 | color: purple;
47 | }
48 | ul, ol {
49 | padding: 0;
50 | margin: 0;
51 | }
52 | li {
53 | line-height: 24px;
54 | }
55 | li ul, li ul {
56 | margin-left: 24px;
57 | }
58 | p, ul, ol {
59 | font-size: 16px;
60 | line-height: 24px;
61 | max-width: 540px;
62 | }
63 | pre {
64 | padding: 0px 24px;
65 | max-width: 800px;
66 | white-space: pre-wrap;
67 | }
68 | code {
69 | font-family: Consolas, Monaco, Andale Mono, monospace;
70 | line-height: 1.5;
71 | font-size: 13px;
72 | }
73 | aside {
74 | display: block;
75 | float: right;
76 | width: 390px;
77 | }
78 | blockquote {
79 | border-left:.5em solid #eee;
80 | padding: 0 2em;
81 | margin-left:0;
82 | max-width: 476px;
83 | }
84 | blockquote cite {
85 | font-size:14px;
86 | line-height:20px;
87 | color:#bfbfbf;
88 | }
89 | blockquote cite:before {
90 | content: '\2014 \00A0';
91 | }
92 |
93 | blockquote p {
94 | color: #666;
95 | max-width: 460px;
96 | }
97 | hr {
98 | width: 540px;
99 | text-align: left;
100 | margin: 0 auto 0 0;
101 | color: #999;
102 | }
103 |
104 | /* Code below this line is copyright Twitter Inc. */
105 |
106 | button,
107 | input,
108 | select,
109 | textarea {
110 | font-size: 100%;
111 | margin: 0;
112 | vertical-align: baseline;
113 | *vertical-align: middle;
114 | }
115 | button, input {
116 | line-height: normal;
117 | *overflow: visible;
118 | }
119 | button::-moz-focus-inner, input::-moz-focus-inner {
120 | border: 0;
121 | padding: 0;
122 | }
123 | button,
124 | input[type="button"],
125 | input[type="reset"],
126 | input[type="submit"] {
127 | cursor: pointer;
128 | -webkit-appearance: button;
129 | }
130 | input[type=checkbox], input[type=radio] {
131 | cursor: pointer;
132 | }
133 | /* override default chrome & firefox settings */
134 | input:not([type="image"]), textarea {
135 | -webkit-box-sizing: content-box;
136 | -moz-box-sizing: content-box;
137 | box-sizing: content-box;
138 | }
139 |
140 | input[type="search"] {
141 | -webkit-appearance: textfield;
142 | -webkit-box-sizing: content-box;
143 | -moz-box-sizing: content-box;
144 | box-sizing: content-box;
145 | }
146 | input[type="search"]::-webkit-search-decoration {
147 | -webkit-appearance: none;
148 | }
149 | label,
150 | input,
151 | select,
152 | textarea {
153 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
154 | font-size: 13px;
155 | font-weight: normal;
156 | line-height: normal;
157 | margin-bottom: 18px;
158 | }
159 | input[type=checkbox], input[type=radio] {
160 | cursor: pointer;
161 | margin-bottom: 0;
162 | }
163 | input[type=text],
164 | input[type=password],
165 | textarea,
166 | select {
167 | display: inline-block;
168 | width: 210px;
169 | padding: 4px;
170 | font-size: 13px;
171 | font-weight: normal;
172 | line-height: 18px;
173 | height: 18px;
174 | color: #808080;
175 | border: 1px solid #ccc;
176 | -webkit-border-radius: 3px;
177 | -moz-border-radius: 3px;
178 | border-radius: 3px;
179 | }
180 | select, input[type=file] {
181 | height: 27px;
182 | line-height: 27px;
183 | }
184 | textarea {
185 | height: auto;
186 | }
187 |
188 | /* grey out placeholders */
189 | :-moz-placeholder {
190 | color: #bfbfbf;
191 | }
192 | ::-webkit-input-placeholder {
193 | color: #bfbfbf;
194 | }
195 |
196 | input[type=text],
197 | input[type=password],
198 | select,
199 | textarea {
200 | -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
201 | -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
202 | transition: border linear 0.2s, box-shadow linear 0.2s;
203 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
204 | -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
205 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
206 | }
207 | input[type=text]:focus, input[type=password]:focus, textarea:focus {
208 | outline: none;
209 | border-color: rgba(82, 168, 236, 0.8);
210 | -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
211 | -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
212 | box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
213 | }
214 |
215 | /* buttons */
216 | button {
217 | display: inline-block;
218 | padding: 4px 14px;
219 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
220 | font-size: 13px;
221 | line-height: 18px;
222 | -webkit-border-radius: 4px;
223 | -moz-border-radius: 4px;
224 | border-radius: 4px;
225 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
226 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
227 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
228 | background-color: #0064cd;
229 | background-repeat: repeat-x;
230 | background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
231 | background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
232 | background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
233 | background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
234 | background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
235 | background-image: -o-linear-gradient(top, #049cdb, #0064cd);
236 | background-image: linear-gradient(top, #049cdb, #0064cd);
237 | color: #fff;
238 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
239 | border: 1px solid #004b9a;
240 | border-bottom-color: #003f81;
241 | -webkit-transition: 0.1s linear all;
242 | -moz-transition: 0.1s linear all;
243 | transition: 0.1s linear all;
244 | border-color: #0064cd #0064cd #003f81;
245 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
246 | }
247 | button:hover {
248 | color: #fff;
249 | background-position: 0 -15px;
250 | text-decoration: none;
251 | }
252 | button:active {
253 | -webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
254 | -moz-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
255 | box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
256 | }
257 | button::-moz-focus-inner {
258 | padding: 0;
259 | border: 0;
260 | }
261 |
--------------------------------------------------------------------------------
/markdowneditor/resources/3rdparty/marked.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * marked - a markdown parser
3 | * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
4 | * https://github.com/chjj/marked
5 | */
6 | (function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i.5){ch="x"+ch.toString(16)}out+=""+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"