NMF-earth / nmf-app

Understand and reduce your carbon footprint 🌱 iOS & Android.
https://nmf.earth
GNU General Public License v3.0
498 stars 156 forks source link

Improve guides #199

Closed PierreBresson closed 3 years ago

PierreBresson commented 3 years ago
Screenshot 2020-10-10 at 21 07 13
BatDroid commented 3 years ago

I'm on it. just wondering if I should make one pr per to do or one for all

BatDroid commented 3 years ago

I just added all in one pr so that It won't be labeled as spam sth

PierreBresson commented 3 years ago

@BatDroid I won't close this ticket for now because the alignment issue persist if I run node scripts/generate-guides.js

BatDroid commented 3 years ago

@BatDroid I won't close this ticket for now because the alignment issue persist if I run node scripts/generate-guides.js

I couldn't find the way the guides were generated. I just changed the generated file. I'll fix it in a new PR. btw, Though I could see it in the docs that you've mentioned about it, I believe it would be good to have a comment line like this in the generated file. / this is a generated file. change the md files. modify the md files & run the node script/... to see the result /

BatDroid commented 3 years ago

@BatDroid I won't close this ticket for now because the alignment issue persist if I run node scripts/generate-guides.js

I face this error when I run the mentioned generate-guides.js . doesn't it happen to you? Simulator Screen Shot - iPhone 11 - 2020-10-12 at 00 11 32

PierreBresson commented 3 years ago

@BatDroid humm nope, I'm on latest master and node scripts/generate-guides.js works well for me.

BatDroid commented 3 years ago

@BatDroid humm nope, I'm on latest master and node scripts/generate-guides.js works well for me.

Sorry, I tried everything and I still face the error. I even cloned the main repo and ran it there and this error happens after I run the script.I couldn't find the source of my problem and maybe it is related to my node version which is v14.4.0. I'll work on other issues. Just for who ever going to to this. It should be related to internet-browsing-impact.md because the other guides work without any problem. what I did on the generated file was exactly the same. removing the generated p tags that doesn't exists in the others.

hb2708 commented 3 years ago

@PierreBresson I was looking into this now. But when i run node scripts/generate-guides.js it does nothing. as per the script i see it should log "Wrote guides.json" at the end. So to debug that i added console log for files but it prints an empty array. am i not doing it correctly?

PierreBresson commented 3 years ago

@hb2708 I think it's because you need to run the script within the folder if I remember well. So cd scripts and then node generate-guides.js... yes, some improvement is needed ;)

hb2708 commented 3 years ago

@PierreBresson Nope does not work .readdirSync(${process.env.PWD}/assets/images/guide) fails with following error

Error: ENOENT: no such file or directory, scandir '/Users/harshalbhavsar/Documents/Harshal/nmf-app/scripts/assets/images/guide'

But if i changed this const guidesPath = "../assets/guides/markdown/*.md"; to const guidesPath =${process.env.PWD}/assets/guides/markdown/*.md; Works so will test that way. And then you can give a try to the scripts part

hb2708 commented 3 years ago

@PierreBresson Does this looks good?

  1. Fixed the alignment issue By changing the .md File.
  2. Made the hyperlink 1,3 Bold same as the 2nd one
Before After
Before After
hb2708 commented 3 years ago

@PierreBresson let me know if the above works for you then will create a pr. Thanks

PierreBresson commented 3 years ago

@hb2708 thanks for sharing the way to resolve the issue, I've pushed a temporary fix and open a ticket for a long term solution

hb2708 commented 3 years ago

@PierreBresson happy to help