Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add importer which imports files from .md/.txt #325

Merged
merged 5 commits into from
Jun 16, 2017
Merged

Add importer which imports files from .md/.txt #325

merged 5 commits into from
Jun 16, 2017

Conversation

asmsuechan
Copy link
Contributor

@asmsuechan asmsuechan commented Mar 16, 2017

Hi there. I implemented a function which imports files from .md or .txt.

screen shot 2017-03-16 at 13 12 38

Specifications

  • multiple files
  • .md or .txt

If someone wants what else, please comment.

TODO

  • fill a title after imported immediately

I'll implement fill a title after #324 is merged.

Future

  • enable to import files from a directory

@sota1235
Copy link
Contributor

Sorry, firstly plz fix conflicts 🙇

@asmsuechan
Copy link
Contributor Author

Alright. Done.

@GaryFurash
Copy link

How do I get this? It's not in the current download.

@sota1235
Copy link
Contributor

@GaryFurash This feature is in progress now. So wait a moment please... 🙇

@sota1235
Copy link
Contributor

@asmsuechan Thanks. I'll check 💡

}

const targetIndex = _.findIndex(this.notes, (note) => {
return note != null && note.storage + '-' + note.key === location.query.key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you use strict equal? !==
And you can use template literal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing.

if (filepaths === undefined) return
filepaths.forEach((filepath) => {
fs.readFile(filepath, (err, data) => {
if (err) throw Error('File reading error: ', err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question] Do you test this situation? Doesn't it crush?

Copy link
Contributor Author

@asmsuechan asmsuechan May 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, I tried by hand, but the probability is quite low.

@jasondavis
Copy link

Just an idea that is related to this....what about the ability to upload a ZIP archive file that contains multiple files of any of these formats,

  • MD
  • TXT
  • JS
  • PHP
  • CSS
  • HTML
  • LESS
  • SCSS
  • and other code files

Boostnote would then create a Code Snippet File in Boostnote and add a sub-file/tab file for each file in the ZIP archive that is in the allowed formats.

Just an idea

filepaths.forEach((filepath) => {
fs.readFile(filepath, (err, data) => {
if (err) throw Error('File reading error: ', err)
// TODO: fill the title
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna open another PR to implement a module for findTitle().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should use the method, so I have to wait for merging it.
#548

@kazup01 kazup01 added the awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. label May 17, 2017
@asmsuechan asmsuechan removed the awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. label Jun 13, 2017
@asmsuechan asmsuechan merged commit d9b2981 into BoostIO:master Jun 16, 2017
@asmsuechan asmsuechan deleted the feature-import-from-md-file branch June 16, 2017 12:28
@kohei-takata kohei-takata mentioned this pull request Jun 24, 2017
@GaryFurash
Copy link

Is this working yet? It doesn't work on my Windows 7 or Windows 10 PC.

@asmsuechan
Copy link
Contributor Author

@GaryFurash I'm going to try fixing it in a few days.

@asmsuechan
Copy link
Contributor Author

asmsuechan commented Jul 25, 2017

@GaryFurash Well, it seems to work fine in my environment (master branch on windows 10). Please open a new issue with screenshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants