# Ticket #6495: trac_6495-script-jhp.sh

File trac_6495-script-jhp.sh, 2.7 KB (added by , 6 years ago) |
---|

Line | |
---|---|

1 | #!/usr/bin/env bash |

2 | |

3 | set -e |

4 | |

5 | hg() { |

6 | sage --hg --verbose "$@" |

7 | } |

8 | |

9 | |

10 | if [[ `pwd` != */doc/en/reference ]]; then |

11 | echo "Must be run in devel/sage/doc/en/reference/" |

12 | exit 1 |

13 | fi |

14 | |

15 | for f in algebras arithgroup calculus categories cmd coding coercion constants cryptography databases finance finite_rings function_fields functions games geometry graphs groups hecke history_and_license homology interfaces lfunctions libs logic matrices misc modabvar modfrm modmisc modsym modules monoids notebook number_fields numerical padics parallel plane_curves plot3d plotting polynomial_rings power_series probability quadratic_forms quat_algebras rings rings_numerical rings_standard sat schemes semirings stats structure tensor |

16 | do |

17 | hg rename $f.rst $f/index.rst |

18 | # delete lines of the form ".. _ch:blah" |

19 | sed -e 's|^\.\. _ch:.*$||' -i '' $f/index.rst |

20 | # remove resulting blank lines from top of file |

21 | sed -e '/./,$!d' -i '' $f/index.rst |

22 | cat >$f/conf.py <<EOF |

23 | # -*- coding: utf-8 -*- |

24 | # This file is execfile()d with the current directory set to its |

25 | # containing dir. |

26 | # |

27 | # The contents of this file are pickled, so don't put values in the |

28 | # namespace that aren't pickleable (module imports are okay, they're |

29 | # removed automatically). |

30 | # |

31 | # All configuration values have a default; values that are commented |

32 | # out serve to show the default. |

33 | |

34 | # See the parent directory's conf_sub module for details. |

35 | import sys |

36 | sys.path.append('..') |

37 | from conf_sub import * |

38 | EOF |

39 | cat >> $f/index.rst <<EOF |

40 | |

41 | .. include:: ../footer.txt |

42 | EOF |

43 | |

44 | hg add $f/conf.py |

45 | done |

46 | |

47 | cp cmd/conf.py combinat/conf.py |

48 | hg add combinat/conf.py |

49 | # in combinat/index.rst: change "../sage/combinat/blah" to "sage/combinat/blah" |

50 | sed -e "s|\.\./||" -i '' combinat/index.rst |

51 | |

52 | cat >> combinat/index.rst <<EOF |

53 | |

54 | .. include:: ../footer.txt |

55 | EOF |

56 | |

57 | for f in environ.rst options.rst startup.rst |

58 | do |

59 | hg rename $f cmd/ |

60 | done |

61 | |

62 | for f in polynomial_rings_infinite.rst polynomial_rings_laurent.rst polynomial_rings_multivar.rst polynomial_rings_toy_implementations.rst polynomial_rings_univar.rst |

63 | do |

64 | hg rename $f polynomial_rings/ |

65 | done |

66 | |

67 | hg rename other/sagetex.rst misc/sagetex.rst |

68 | |

69 | hg rename media/modular/arithgroup/pairing.png arithgroup/media/pairing.png |

70 | |

71 | for d in combinat graphs homology; do |

72 | mkdir -p $d/media |

73 | for f in `ls media/$d`; do |

74 | hg rename media/$d/$f $d/media/$f |

75 | done |

76 | done |

77 | |

78 | hg commit -l /dev/stdin -u "J. H. Palmieri <palmieri@math.washington.edu>" <<EOF |

79 | Trac #6495: Break reference manual into manageable pieces. |

80 | |

81 | doc/en/reference: move MODULE.rst to MODULE/index.rst, create MODULE/conf.py. |

82 | Add ".. include:: ../footer.txt" to the end of each file MODULE/index.rst. |

83 | Move media files from media/ to MODULE/media/ |

84 | Remove chapter cross-references (".. _ch:...") from MODULE/index.rst |

85 | EOF |