import os, glob, sys
import nustack
import nustack.doc.gen as gen

exportdir = sys.argv[1]

# Get module names
path = os.path.join(os.path.dirname(nustack.__file__), "stdlib")
print("Path to standard library:", path)
os.chdir(path)
modnames = (f[:-3] for f in glob.iglob("*.py") if f != '__init__.py')

for mod in modnames:
    print("Generating docs for %s..." % mod)
    gen.gendoc("nustack.stdlib.%s" % mod, os.path.join(exportdir, mod + ".md"))
print("Done!")

import os, glob, sys
import nustack
import gen

exportdir = sys.argv[1]

# Get module names
path = os.path.join(nustack.__path__[0], "stdlib")
print("Path to standard library:", path)
os.chdir(path)
modnames = (f[:-3] for f in glob.iglob("*.py") if f != '__init__.py')

for mod in modnames:
    print("Generating docs for %s..." % mod)
    gen.gendoc("nustack.stdlib.%s" % mod, os.path.join(exportdir, mod + ".md"))
print("Done!")

Update documentation generator for new directory structure.
Update documentation generator for new directory structure.

  import os, glob, sys
  import nustack
- import nustack.doc.gen as gen
+ import gen
  
  exportdir = sys.argv[1]
  
  # Get module names
- path = os.path.join(os.path.dirname(nustack.__file__), "stdlib")
+ path = os.path.join(nustack.__path__[0], "stdlib")
  print("Path to standard library:", path)
  os.chdir(path)
  modnames = (f[:-3] for f in glob.iglob("*.py") if f != '__init__.py')
  
  for mod in modnames:
      print("Generating docs for %s..." % mod)
      gen.gendoc("nustack.stdlib.%s" % mod, os.path.join(exportdir, mod + ".md"))
  print("Done!")
  
Update documentation generator for new directory structure.
## Code Before:
import os, glob, sys
import nustack
import nustack.doc.gen as gen

exportdir = sys.argv[1]

# Get module names
path = os.path.join(os.path.dirname(nustack.__file__), "stdlib")
print("Path to standard library:", path)
os.chdir(path)
modnames = (f[:-3] for f in glob.iglob("*.py") if f != '__init__.py')

for mod in modnames:
    print("Generating docs for %s..." % mod)
    gen.gendoc("nustack.stdlib.%s" % mod, os.path.join(exportdir, mod + ".md"))
print("Done!")

## Instruction:
Update documentation generator for new directory structure.
## Code After:
import os, glob, sys
import nustack
import gen

exportdir = sys.argv[1]

# Get module names
path = os.path.join(nustack.__path__[0], "stdlib")
print("Path to standard library:", path)
os.chdir(path)
modnames = (f[:-3] for f in glob.iglob("*.py") if f != '__init__.py')

for mod in modnames:
    print("Generating docs for %s..." % mod)
    gen.gendoc("nustack.stdlib.%s" % mod, os.path.join(exportdir, mod + ".md"))
print("Done!")
